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 is #line in c?
List the variables are used for writing doubly linked list program.
What is sizeof int?
1) There is a singing competition for children going to be conducted at a local club. Parents have been asked to arrive at least an hour before and register their children’s names with the Program Manager. Whenever a participant registers, the Program Manager has to position the name of the person in a list in alphabet order. Write a program to help the Program Manager do this by placing the name in the right place each time the Program Manger enters a name. 2) the Event Manager has to send participants to the stage to perform in the order in which they registered. Write a program that will help the Event Manager know who to call to the stage to perform. The Logic should be in Data Structures
what do you mean by enumeration constant?
When should the volatile modifier be used?
Write a program to print ASCII code for a given digit.
What would the following code segment printint k = 8;docout << "k = " << k << " ";while k++ < 5; a) 13 b) 5 c) 8 d) pointers
What is data structure in c and its types?
How many loops are there in c?
What are the three constants used in c?
What are operators in c?
How do I use void main?
Draw a diagram showing how the operating system relates to users, application programs, and the computer hardware ?
How to find a missed value, if you want to store 100 values in a 99 sized array?