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 programme to find even numbers without using any 
conditional statement?
 Question Submitted By :: Rasmita Rout
I also faced this Question!!     Rank Answer Posted By  
 
  Re: Write a programme to find even numbers without using any conditional statement?
Answer
# 1
#nclude<stdio.h>
#include<conio.h>
void main()
{
int a,b,c;
clrscr();
printf("\n Enter the numbers for a,b,c:");
scanf("%d%d",&a,&b);
c=a/b;
c=0;
printf("The given number is even");
getch();
}
 
Is This Answer Correct ?    3 Yes 21 No
Guest
 
  Re: Write a programme to find even numbers without using any conditional statement?
Answer
# 2
#include<stdio.h>
main()
{
   char res[2][5]={"Even","Odd"};
   int n;
   printf("Enter a number :");
   scanf("%d",&n);
   printf("the given no is = %s",res[n%2]);
}
 
Is This Answer Correct ?    19 Yes 3 No
Mathiyazhagan
 
 
 
  Re: Write a programme to find even numbers without using any conditional statement?
Answer
# 3
#include<stdio.h>
#include<conio.h>
main()
{
int a,b,c,d;  /*declaring variable using int*/
clrscr();
printf("enter the numbers:")
scanf("/n%d/n%d",&a,&b);/*getting number using scanf*/
c=a,b;
d=(c/2==0);
printf("the even number is:%d",d)/*print the final answer*/
getch();
}
 
Is This Answer Correct ?    3 Yes 9 No
Sridhar
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
What is meaning of "Void main" in C Language. TCS8
define function Assurgent4
how do u find out the number of 1's in the binary representation of a decimal number without converting it into binary(i mean without dividing by 2 and finding out the remainder)? three lines of c code s there it seems...can anyone help  2
what will the following program do? void main() { int i; char a[]="String"; char *p="New Sring"; char *Temp; Temp=a; a=malloc(strlen(p) + 1); strcpy(a,p); //Line no:9// p = malloc(strlen(Temp) + 1); strcpy(p,Temp); printf("(%s, %s)",a,p); free(p); free(a); } //Line no 15// a) Swap contents of p & a and print:(New string, string) b) Generate compilation error in line number 8 c) Generate compilation error in line number 5 d) Generate compilation error in line number 7 e) Generate compilation error in line number 1 IBM1
what is data structure  4
Which of the following about the C comments is incorrect ? a.commentscan go over multiple lines b.comments can start any where in the line c.a line can contain comments with out any language statements d.comments can occur within comments TCS6
What is #pragma directive?how it is used in the program? what is its advantages and disadvantages?  1
Why doesn't the code "int a = 1000, b = 1000; long int c = a * b;" work?  6
convert 12345 to 54321 withoutusing strig  3
swap two integer variables without using a third temporary variable?  2
f() { int a=2; f1(a++); } f1(int c) { printf("%d", c); } c=? Geometric-Software2
how does printf function work  1
const char * char * const What is the differnce between the above tow?. TCS5
#define d 10+10 main() { printf("%d",d*d); }  3
Why is conio.h not required when we save a file as .c and use clrscr() or getch() ?  2
What are data breakpoints? Adobe1
Write one statement equalent to the following two statements x=sqr(a); return(x); Choose from one of the alternatives a.return(sqr(a)); b.printf("sqr(a)"); c.return(a*a*a); d.printf("%d",sqr(a)); TCS4
what is a headerfile?and what will be a program without it explain nan example? Assurgent5
what is meant by c  4
Predict the output or error(s) for the following: 25. main() { printf("%p",main); } ME3
 
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