ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip       Ask Questions on ANYTHING, that arise in your Daily Life at     FORUM9.COM
Google
 
Categories  >>  Software  >>  Programming Languages  >>  C
 
 


 

 
 C interview questions  C Interview Questions
 C++ interview questions  C++ Interview Questions
 VC++ interview questions  VC++ Interview Questions
 Delphi interview questions  Delphi Interview Questions
 Programming Languages AllOther interview questions  Programming Languages AllOther Interview Questions
Question
write a program to print the all 4digits numbers & whose 
squares must me even numbers?
 Question Submitted By :: Swetha Krishnamaneni
I also faced this Question!!     Rank Answer Posted By  
 
  Re: write a program to print the all 4digits numbers & whose squares must me even numbers?
Answer
# 1
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 2 No
Abdur Rab
 
  Re: write a program to print the all 4digits numbers & whose squares must me even numbers?
Answer
# 2
#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 ?    0 Yes 0 No
Ruchi
 
 
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
main() { char *p1="Name"; char *p2; p2=(char *)malloc(20); while(*p2++=*p1++); printf("%s\n",p2); } what is the output? Ramco4
difference between i++* and *++i IBM3
related to rdbms query .  1
let's take a code struct FAQ { int a; char b; float c; double d; int a[10]; }*temp; now explain me how the memory will be allocated for the structure FAQ and what address will be in the structure pointer (temp)....................  7
program to find a smallest number in an array Microsoft5
Sir i want e-notes of C languge of BAlaguruswami book i.e scanned or pdf file of balaguruswamy book on c language.PLEASE SEND ME on my mail id ajit_kolhe@rediff.com  4
Write a program to interchange two variables without using the third variable? Accenture11
main() { int i,j,A; for(A=-1;A<=1;A++) prinf("%d\t",!!A); }  5
main() { int i = 1; int num[] = {1,2,3,4}; num[i] = i++; printf("%d", num[i]); } what will be the output? } NDS15
what is pointer TCS1
to find the program of matrix multiplication using arrays  2
what is the use of call back function in c?tell me with example  1
What's wrong with the call "fopen ("c:\newdir\file.dat", "r")"?  1
If "AaBbCc" is passed to the char char x(*a) { a[0]?x(a+1):1; printf("%c",a[0]); return 1; } what will be the output? Hughes5
Total of how many functions are available in c?  2
Write a C program to print 1 2 3 ... 100 without using loops?  5
what is Structural oriented language? give some example of this language.....?  1
How to implement variable argument functions ? HP1
how many argument we can pas in in a function CTS20
write a program that explain #define and # undef directive  1
 
For more C Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com