find a number whether it is even or odd without using any
control structures and relational operators?
Answer Posted / ramesh
#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 ? | 3 Yes | 1 No |
Post New Answer View All Answers
Want to know how to write a C program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the total number of disk writes by MySQL.
What does c mean in standard form?
Write a program in c to replace any vowel in a string with z?
What is calloc() function?
What is the function of volatile in c language?
How do you print only part of a string?
Explain enumerated types in c language?
How can I check whether a file exists? I want to warn the user if a requested input file is missing.
What is a example of a variable?
In C, What is the #line used for?
How do you sort filenames in a directory?
Write program to remove duplicate in an array?
what is the structure pointer?
What is d'n in c?
Do you know the difference between exit() and _exit() function in c?