Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

Apart from dennis ritchie who the other person who contributed in design of c language.

0 Answers  


how can we Declare a variable in c without defining it.

1 Answers   TCS,


a parameter passed between a calling program and a called program a) variable b) constant c) argument d) all of the above

0 Answers  


exit () is used to a) exit () terminates the execution of the program itself b) exit () terminates the execution of the loop c) exit () terminates the execution of the block d) none of the above

0 Answers  


why r u join this company? give solid resons.

16 Answers   IBM, Infosys, TCS,


main() { int i=0; while(+(+i--)!=0) i-=i++; printf(i); }

3 Answers  


What is meant by type casting?

0 Answers  


sqrt(x+sqrt(x+sqrt(x+sqrt(x))))=2; Find the value of x?

4 Answers   Subex,


What is difference between union and structure in c?

0 Answers  


What is the advantage of an array over individual variables?

0 Answers  


What is s or c?

0 Answers  


Write a Program to accept different goods with the number, price and date of purchase and display them

0 Answers   HDFC,


Categories