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                      
Do you have a collection of Interview Questions and interested to share with us!!
Please send that collection to along with your userid / name. ThanQ
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 c program to print a given number as odd or even 
without using loop statements,(no if ,while etc)
 Question Submitted By :: Aparajit Lal Kumar
I also faced this Question!!     Rank Answer Posted By  
 
  Re: write a c program to print a given number as odd or even without using loop statements,(no if ,while etc)
Answer
# 1
#include<stdio.h>
#include<conio.h>
void main()
{
int m;
printf("0 - odd number \t 1 - even number\n");
printf("enter the number :");
scanf("%d",&m);
printf(" %d ",m&1);
getch();
}


thank u
 
Is This Answer Correct ?    9 Yes 4 No
Vignesh1988i
 
  Re: write a c program to print a given number as odd or even without using loop statements,(no if ,while etc)
Answer
# 2
sorry , just change printf() as.... printf("0 - even number \t 1 - odd number \n ");

thank u
 
Is This Answer Correct ?    0 Yes 1 No
Vignesh1988i
 
 
 
  Re: write a c program to print a given number as odd or even without using loop statements,(no if ,while etc)
Answer
# 3
bogoon
 
Is This Answer Correct ?    0 Yes 1 No
Jan
 
  Re: write a c program to print a given number as odd or even without using loop statements,(no if ,while etc)
Answer
# 4
(number & 1) ? (odd) : (even);
 
Is This Answer Correct ?    1 Yes 1 No
Taesung Kim
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
How to implement call back functions ? HP2
What is sparse file?  1
The differences between Windows XP and Windows Visa HCL7
what is the diff between the printf and sprintf functions?? and what is the syntax for this two functions ??  4
WRITE A PROGRAM TO PRINT THE FOLLOWING OUTPUTS USING FOR LOOPS. A) * B) ***** *** * * ***** * * *****  2
#include <stdio.h> #define sqr(x) (x*x) int main() { int x=2; printf("value of x=%d",sqr(x+1)); } What is the value of x? Oracle13
What is the difference between null pointer and the void pointer?  2
#include<stdio.h> main() { char s1[]="Ramco"; char s2[]="Systems"; s1=s2; printf("%s",s1); } what will happen if you executed this code? Ramco4
What is the meaning When we write "#include" what is # and what does include does there??? HCL11
what is dangling pointer? LG-Soft1
main() { int arr[5]={23,67}; printf("%d%d%d",arr[2],arr[3],arr[4]); } TCS6
What's wrong with "char *p; *p = malloc(10);"?  5
#include<stdio.h> int fun(); int i; int main() { while(i) { fun(); main(); } printf("hello \n"); return 0; } int fun() { printf("hi"); } answer is hello.how??wat is tat while(i) mean? Intel4
Is it possible to create recycle bin in mobiles?  2
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
how to sort two array of characters and make a new array of characters. Accenture1
f=(x>y)?x:y a) f points to max of x and y b) f points to min of x and y c)error HCL4
int main() { int *p=new int; *p=10; del p; cout<<*p; *p= 60; cout<<*p; } what will be the output & why? TCS4
please give me answer with details #include<stdio.h> main() { int i=1; i=(++i)*(++i)*(++i); printf("%d",i); getch(); }  3
C,c++, Java is all are structural oriented or procedure oriented language..?  3
 
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