Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


To find whether a number is even or odd without using any
conditional operator??

Answers were Sorted based on User's Feedback



To find whether a number is even or odd without using any conditional operator??..

Answer / kala

main()
{
int n;
printf("enter the number\n");
scanf("%d",&n);
if(n%2==0){
printf("number is even");}
else{
printf("number is odd");
}
}
or
if(n&1==0)
printf("even number");
else
printf(odd number");

Is This Answer Correct ?    31 Yes 38 No

To find whether a number is even or odd without using any conditional operator??..

Answer / sahithya

void main()
{
int n;
printf("enter n:");
scanf("%d",&n);
if(n%2==0)
printf( "even");
else
printf("odd");
}

Is This Answer Correct ?    15 Yes 34 No

Post New Answer

More C Interview Questions

Study the following C program :call_me (myvar)int myvar;{ myvar +- 5; }main(){int myvar;myvar = 3;call_me(myvar);printf("%d ",myvar);What will be printed a) 3 b) 5 c) 8 d) symbol

0 Answers  


What is structure in c language?

0 Answers  


write an algorithm which can find the largest number among the given list using binary search ............... this was asked in the interview

2 Answers   Satyam, UNIS, Wipro,


write a programming in c to find the sum of all elements in an array through function.

0 Answers  


x=2,y=6,z=6 x=y==z; printf(%d",x)

13 Answers   Bharat, Cisco, HCL, TCS,


Can the sizeof operator be used to tell the size of an array passed to a function?

0 Answers  


Write code for initializing one dimentional and two dimentional array in a C Program?

5 Answers   Deshaw, Edutech, GMD,


main() { clrscr(); } clrscr();

6 Answers   ME, Wipro,


Subtract Two Number Without Using Subtraction Operator

0 Answers  


what will be the output of this program........ main() { int a=2,b=4,c=6; printf("%d"); } why it gives the value of third variable.

6 Answers   HCL,


Where register variables are stored in c?

0 Answers  


How can we allocate array or structure bigger than 64kb?

2 Answers   CSC,


Categories