To find whether a number is even or odd without using any
conditional operator??

Answer Posted / umair jatoi && zain ja

/* ZAIN JATOI AND UMAIR JATOI */
#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
int n;
printf("Enter any number:");
scanf("%d",&n);
if(n&1)
printf("%d is Odd number",n);
else
printf("%d is even number",n);
getch();
}

Is This Answer Correct ?    2 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is return type in c?

639


When do you not use the keyword 'return' when defining a function a) Always b) Never c) When the function returns void d) dfd

642


Can we change the value of constant variable in c?

576


What is #include stdlib h?

616


What is the size of enum in c?

621






What is the sizeof () operator?

624


Explain what is a 'locale'?

585


Can we declare variables anywhere in c?

580


Why dont c comments nest?

621


Is there anything like an ifdef for typedefs?

702


Explain data types & how many data types supported by c?

586


What is the difference between printf and scanf )?

595


What is the use of define in c?

597


Is c still used?

604


Write a C program in Fibonacci series.

635