Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

find a number whether it is even or odd without using any
control structures and relational operators?

Answer Posted / gganesh

#include<stdio.h>
#include<conio.h>
void main()
{
int n;
clrscr();
printf("Enter the number : ");
scanf("%d",&n);
n%2?printf("Odd"):printf("Even");
getch();
}

note: here i used conditional operator, not a relational
operators and control structures

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can I rethow can I return a sequence of random numbers which dont repeat at all?

1147


why we wont use '&' sing in aceesing the string using scanf

2311


Is there a way to have non-constant case labels (i.e. Ranges or arbitrary expressions)?

1018


what is a function method?give example?

2310


Differentiate between full, complete & perfect binary trees.

1052


Sir i need notes for structure,functions,pointers in c language can you help me please

2350


What is static memory allocation? Explain

1033


What is the difference between specifying a constant variable like with constant keyword and #define it? i.e what is the difference between CONSTANT FLOAT A=1.25 and #define A 1.25

1936


What is a stream water?

1127


What is indirection?

1023


What is an example of structure?

981


What is the difference between printf and scanf )?

1023


What are the different types of C instructions?

1245


How many types of operator or there in c?

1023


Can we replace the struct function in tree syntax with a union?

1238