To find whether a number is even or odd without using any
conditional operator??
Answer Posted / azad sable,chiplun.
void main()
{
int n;
clrscr();
printf("enter any no.");;
scanf("%d",&n);
if(n%2==0)/*remainder after division by 2*/
printf("\nthe no. is even");
else
printf("\nthe no. is odd");
}
getch();
}
| Is This Answer Correct ? | 10 Yes | 9 No |
Post New Answer View All Answers
Which is better oop or procedural?
What is typeof in c?
hw can we delete an internal node of binary search tree the internal node has child node..plz write progarm
How can I write functions that take a variable number of arguments?
What happens if header file is included twice?
State two uses of pointers in C?
What is the default value of local and global variables in c?
What is the use of in c?
pgm to find any error in linklist(in single linklist check whether any node points any of previous nodes instead of next node)
What is the use of pointers in C?
Is c language still used?
What is pointer and structure in c?
What are header files why are they important?
Is there any demerits of using pointer?
Find duplicates in a file containing 6 digit number (like uid) in O (n) time.