Write a program to find given number is even or odd without
using any control statement.
Answers were Sorted based on User's Feedback
Answer / rani
#include<stdio.h>
#include<conio.h>
void main()
{
char str[][10]={"even","odd"};
int no;
clrscr();
printf("\nEnter a number...");
scanf("%d",&no);
printf("\n%d is %s",no,str[no%2]);
getch();
}
| Is This Answer Correct ? | 13 Yes | 1 No |
Answer / saneemask
main()
{
{
char a[][5]= {"Even","Odd"};
int n;
printf("Enter any no.: ");
scanf("%d",&n);
printf("%s",a[n%2]);
getch();
}
{
| Is This Answer Correct ? | 3 Yes | 0 No |
what is level of tree if leaf node is at level 4.please explain.
a=0; b=(a=0)?2:3; a) What will be the value of b? why b) If in 1st stmt a=0 is replaced by -1, b=? c) If in second stmt a=0 is replaced by -1, b=?
How can a program be made to print the name of a source file where an error occurs?
What are the different types of pointers?
Can static variables be declared in a header file?
How to write in a function declaration and in function call in which the function has 'n' number of varible or arguments?
How do you write a program which produces its own source code as output?
Can you write a programmer for FACTORIAL using recursion?
What is null in c?
without using arithmatic operator convert an intger variable x into x+1
C program to find all possible outcomes of a dice?
Where static variables are stored in memory in c?