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

will u please send me the placement papers to my mail???????????????????

0 Answers  


how can i get the output 54321 4321 321 21 1 in c programming........???? pls help......

10 Answers   Infosys,


Explain what will be the outcome of the following conditional statement if the value of variable s is 10?

0 Answers  


define c

6 Answers   HCL, TCS,


main() { int x=10,y=15; x=x++; y=++y; printf("%d %d\n",x,y); } output??

19 Answers   EBS, Ramco, Sangwin, TCS,






What happens if a header file is included twice?

0 Answers  


What are the usage of pointer in c?

0 Answers  


What are global variables and explain how do you declare them?

0 Answers  


What is the difference between typedef struct and struct?

0 Answers  


1234554321 1234 4321 123 321 12 21 1 1 12 21 123 321 1234 4321 1234554321

0 Answers  


c program to print a name without using semicolon

9 Answers   TCS, Wipro,


Write a programme to find even numbers without using any conditional statement?

3 Answers   ADD Software, Infosys,


Categories