To find whether a number is even or odd without using any
conditional operator??
Answers were Sorted based on User's Feedback
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 |
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 |
Can we initialize extern variable in c?
Describe how arrays can be passed to a user defined function
How can I get back to the interactive keyboard if stdin is redirected?
Calculate the weighted average of a list of n numbers using the formula xavg = f1x1+f2x2+ ….+ fnxn where the f’s are fractional weighting factors, i.e., 0<=fi<1, and f1+f2+….+fn = 1
what is the difference between procedure oriented and object oriented progaming language
what is the hardware model of CFG( context free grammar)
Write a program that can show the multiplication table.
write a programe returns the number of times the character appears in the string
What is assert and when would I use it?
how is the examination pattern?
write a program to display numbers from 1 to 10 and 10 to 1?
Explain how do you convert strings to numbers in c?