Write a program to find the given number is odd or even
without using any loops(if,for,do,while)

Answers were Sorted based on User's Feedback



Write a program to find the given number is odd or even without using any loops(if,for,do,while)..

Answer / shiv kumar

(num/2==0)? printf("even"):printf("odd");

Is This Answer Correct ?    20 Yes 7 No

Write a program to find the given number is odd or even without using any loops(if,for,do,while)..

Answer / kiran

main()
{
int n;
printf("enter the number");
scanf("%d",&n);
n%2==0?(printf("given number is even");):(printf("given
number is odd"););

Is This Answer Correct ?    8 Yes 3 No

Write a program to find the given number is odd or even without using any loops(if,for,do,while)..

Answer / ramu gurram

#include<stdio.h>
int main()
{
int i;
printf("enter a number \n");
scanf("%d",i);
float f=i%2;
f==0 ? printf("given number is even") : printf("given
number is odd");
return 0;
}

Is This Answer Correct ?    3 Yes 1 No

Write a program to find the given number is odd or even without using any loops(if,for,do,while)..

Answer / taesung kim

(num & 1) ? (odd) : (even);

Is This Answer Correct ?    8 Yes 11 No

Post New Answer

More C Interview Questions

What are logical errors and how does it differ from syntax errors?

0 Answers  


WRITE A PROGRAM TO PRINT THE FOLLOWING OUTPUTS USING FOR LOOPS. A) * B) ***** *** * * ***** * * *****

2 Answers  


what is the difference between c and c++?

7 Answers  


What is .obj file in c?

0 Answers  


largest Of three Number using without if condition?

0 Answers  






What does %p mean c?

0 Answers  


How can I avoid the abort, retry, fail messages?

0 Answers  


Write a program to swap two numbers without using third variable in c?

0 Answers  


what is difference between #include<stdio.h> and #include"stdio.h"

4 Answers  


how to find the binary of a number?

10 Answers   Infosys,


Explain is it better to bitshift a value than to multiply by 2?

0 Answers  


pgm in c to reverse string by word using array(god is love becomes love is god) (no additional array can used,space is only delimiter between words )

2 Answers   Persistent,


Categories