write a program to print the all 4digits numbers & whose
squares must me even numbers?

Answers were Sorted based on User's Feedback



write a program to print the all 4digits numbers & whose squares must me even numbers?..

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

write a program to print the all 4digits numbers & whose squares must me even numbers?..

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

Post New Answer

More C Interview Questions

What are 'near' and 'far' pointers?

0 Answers  


What are identifiers and keywords in c?

0 Answers  


who is the editor of 'pokemon'?

1 Answers  


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?

0 Answers  


is it possible to change the default calling convention in c ?

1 Answers   Aptech,






mplementation of stack using any programing language

1 Answers   Marlabs,


What is volatile keyword in c?

0 Answers  


What is keyword in c?

0 Answers  


What is void main () in c?

0 Answers  


What is c method?

0 Answers  


What is an operator?

0 Answers  


What are the advantages of c language?

0 Answers  


Categories