find a number whether it is even or odd without using any
control structures and relational operators?
Answer Posted / rohit agarwal
#include<stdio.h>
#include<conio.h>
main()
{
int n;
char *p[]={"Even","odd"};
clrscr();
printf("Enter the number");
scanf("%d",&n);
n=n%2;
printf("The value is %s",p[n]);
getch();
| Is This Answer Correct ? | 1 Yes | 2 No |
Post New Answer View All Answers
What are the advantages of external class?
Create a registration form application by taking the details like username, address, phone number, email with password and confirm password (should be same as password).Ensure that the password is of 8 characters with only numbers and alphabets. Take such details for 3 users and display the details. While taking input password must appear as “****”.
When should you use a type cast?
Explain what is the advantage of a random access file?
What does emoji p mean?
What is chain pointer in c?
What is wild pointer in c?
What is wrong with this code?
c language interview questions & answer
Differentiate Source Codes from Object Codes
I have written a pro*C program to fetch data from the cursor. where in i have used the concept of BULK FETCH.... each FETCH statement is taking lots of time to fetch specified number of rows at...
what is reason of your company position's in india no. 1.
What are the 4 types of unions?
Ow can I insert or delete a line (or record) in the middle of a file?
How can I handle floating-point exceptions gracefully?