write a program to print the all 4digits numbers & whose
squares must me even numbers?
Answers were Sorted based on User's Feedback
Answer / ruchi
#include<stdio.h>
#include<conio.h>
int main()
{
int i,p;
printf("\nNumbers are ");
for(i=1000;i<=9999;i++)
{
p=(i*i);
if(p%2==0)
{
printf("%d\n",i);
}
}
getch();
}
Is This Answer Correct ? | 13 Yes | 0 No |
Answer / abdur rab
Any even number squard will yield an even value
#include <stdio.h>
int main ( int argc, char* argv [] )
{
int nloop = 0;
for ( nloop = 1000; nloop < 10000; nloop++ ) {
if ( ( nloop ) % 2 == 0 ) {
printf ("\n The Number is : %d",
nloop );
}
}
return ( 0 );
}
Is This Answer Correct ? | 2 Yes | 6 No |
What are 'near' and 'far' pointers?
What are identifiers and keywords in c?
who is the editor of 'pokemon'?
Write a C program on Centralized OLTP, Decentralized OLTP using locking mechanism, Semaphore using locking mechanism, Shared memory, message queues, channel of communication, sockets and a simple program on Saving bank application program using OLTP in IPC?
is it possible to change the default calling convention in c ?
mplementation of stack using any programing language
What is volatile keyword in c?
What is keyword in c?
What is void main () in c?
What is c method?
What is an operator?
What are the advantages of c language?