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
What's the right way to use errno?
What is a dynamic array in c?
What is a good data structure to use for storing lines of text?
Can we declare a function inside a function in c?
What does #pragma once mean?
Is main an identifier in c?
what is stack , heap ,code segment,and data segment
What are the difference between a free-standing and a hosted environment?
What will the preprocessor do for a program?
How can you invoke another program from within a C program?
to find the closest pair
What is type qualifiers?
What is unary operator?
Describe how arrays can be passed to a user defined function
How can I delete a file?