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 dangling pointers in c?

0 Answers  


In the DOS enveronment, normal RAM that resides beyond the 1mb mark. a) expanded memory b) swapped memory c) Extended memory d) none

0 Answers  


How can I sort more data than will fit in memory?

0 Answers  


int j =15,i; for (i=1; 1<5; ++i) {printf ("%d%d ",j,i); j = j-3; }

2 Answers  


int main() { int *p=new int; *p=10; del p; cout<<*p; *p= 60; cout<<*p; } what will be the output & why?

4 Answers   TCS,






Is it possible to pass an entire structure to functions?

0 Answers  


What is file in c language?

0 Answers  


What are the 4 types of programming language?

0 Answers  


Write a C program that reads a series of strings and prints only those ending in "ed"

2 Answers   Accenture,


How pointer is benefit for design a data structure algorithm?

2 Answers  


what is the c source code for the below output? 1 0 1 1 0 1 0 1 0 1 1 0 1 0 1

0 Answers  


write a program in 'c' to find the value of p[i+1]^n.p,i,n are arguments of a macro and n is a integer

1 Answers  


Categories