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 |
can we declare a function in side the structure?
Explain the use of 'auto' keyword
Difference Between embedded software and soft ware?
how to write optimum code to divide a 50 digit number with a 25 digit number??
What is the difference between void main() and int main()?
Some coders debug their programs by placing comment symbols on some codes instead of deleting it. How does this aid in debugging?
What is this pointer in c plus plus?
Is double link list a linear data structure? If Yes, Why?If No, Why?
9.how do you write a function that takes a variable number of arguments? What is the prototype of printf () function? 10.How do you access command-line arguments? 11.what does ‘#include<stdio.h>’ mean? 12.what is the difference between #include<> and #include”…”? 13.what are # pragma staments? 14.what is the most appropriate way to write a multi-statement macro?
What is the difference between fread and fwrite function?
What is the Purpose of 'extern' keyword in a function declaration?
while running a program, i got the msg that press return key to exit.what that mean in C as there are no such options as far i know.