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 does emoji p mean?

0 Answers  


How can I do peek and poke in c?

0 Answers  


How to reverse alternate words in a given line of string For Eg: my name is narasimha output : my eman is ahmisaran

0 Answers  


Write a C program to fill a rectangle using window scrolling

1 Answers  


the maximum value that an integer constant can have is a) -32767 b) 32767 c) 1.701e+38 d) -1.7014e+38

1 Answers  






What will the preprocessor do for a program?

0 Answers   Aspire, Infogain,


Given an unsigned integer, find if the number is power of 2?

5 Answers  


what is the difference between auto and static keywords

1 Answers   cDot, College School Exams Tests, TCS,


what is array?

8 Answers  


What is difference between far and near pointers?

0 Answers  


Develop a program that computes the new price of an item. The program should receive a character variable colour and a double precision floating-point variable price from the user. Discount rate is determined based on the colour of the discount sticker, as shown in the following table. An error message should be printed if an invalid colour has been entered

1 Answers  


how many keywords are available in 'c' language a) 32 b) 34 c) 45 d) 48

1 Answers  


Categories