To find whether a number is even or odd without using any
conditional operator??
Answer Posted / umair jatoi && zain ja
/* ZAIN JATOI AND UMAIR JATOI */
#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
int n;
printf("Enter any number:");
scanf("%d",&n);
if(n&1)
printf("%d is Odd number",n);
else
printf("%d is even number",n);
getch();
}
| Is This Answer Correct ? | 2 Yes | 2 No |
Post New Answer View All Answers
What is array of structure in c programming?
Can you write the function prototype, definition and mention the other requirements.
How would you obtain the current time and difference between two times?
Can you please compare array with pointer?
What is unary operator?
What is the significance of an algorithm to C programming?
You are to write your own versions of strcpy() and strlen (). Call them mystrcpy() and mystrlen(). Write them first as code within main(), not as functions, then, convert them to functions. You will pass two arrays to the function in the case of mystrcpy(), the source and target array.
Disadvantages of C language.
What is the general form of function in c?
Can you explain the four storage classes in C?
What does emoji p mean?
What is structure in c definition?
Explain what are the __date__ and __time__ preprocessor commands?
Explain how do you list files in a directory?
What is a dynamic array in c?