what is the other ways to find a logic to print whether a
number is an even or odd wit out using % symbol??????? i
know three different ways to print it. so i need any other
different logic>>>>>
Answer Posted / govind279
#include<stdio.h>
main()
{
int x;
printf("Enter an ineteger ");
scanf("%d",&x);
if(x&0x1)
printf("Odd\n");
else
printf("Even\n");
}
| Is This Answer Correct ? | 7 Yes | 0 No |
Post New Answer View All Answers
Explain how can I read and write comma-delimited text?
I came across some code that puts a (void) cast before each call to printf. Why?
Explain what would happen to x in this expression: x += 15; (assuming the value of x is 5)
what is recursion in C
The number of bytes of storage occupied by short, int and long are a) 2, 2 and 4 b) 2, 4 and 4 c) 4, 4 and 4 d) none
Describe the difference between = and == symbols in c programming?
What does dm mean sexually?
Explain with the aid of an example why arrays of structures don’t provide an efficient representation when it comes to adding and deleting records internal to the array.
Differentiate between #include<...> and #include '...'
is it possible to create your own header files?
Why is sizeof () an operator and not a function?
How is a macro different from a function?
What does s c mean on snapchat?
Explain how do you declare an array that will hold more than 64kb of data?
What is structure in c language?