write a c program to print a given number as odd or even
without using loop statements,(no if ,while etc)
Answer Posted / vignesh1988i
#include<stdio.h>
#include<conio.h>
void main()
{
int m;
printf("0 - odd number \t 1 - even number\n");
printf("enter the number :");
scanf("%d",&m);
printf(" %d ",m&1);
getch();
}
thank u
| Is This Answer Correct ? | 43 Yes | 27 No |
Post New Answer View All Answers
Where local variables are stored in c?
Write a C program linear.c that creates a sequence of
processes with a given length. By
sequence it is meant that each created process has exactly
one child.
Let's look at some example outputs for the program.
Here the entire process sequence consists of process 18181:
Sara@dell:~/OSSS$ ./linear 1
Creating process sequence of length 1.
18181 begins the sequence.
An example for a sequence of length three:
Sara@dell:~/OSSS$ ./linear 3
Creating process sequence of length 3.
18233 begins the sequence.
18234 is child of 18233
18235 is child of 18234
........ this is coad .... BUt i could not compleate it .....:(
#include
What does p mean in physics?
write a program fibonacci series and palindrome program in c
What will be the outcome of the following conditional statement if the value of variable s is 10?
What is non linear data structure in c?
How can I avoid the abort, retry, fail messages?
How can variables be characterized?
What is a pointer in c?
I just typed in this program, and it is acting strangely. Can you see anything wrong with it?
How can I make sure that my program is the only one accessing a file?
What are the restrictions of a modulus operator?
Explain how can I remove the trailing spaces from a string?
What is const keyword in c?
What are the different types of control structures?