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

What are c header files?

988


What are the types of data types and explain?

1088


What is c definition?

1269


Why enum is used in c?

949


What is multidimensional arrays

1120


What is keyword in c?

1007


What is an example of structure?

1039


Explain the use of fflush() function?

1075


What does %c mean in c?

1081


What are identifiers in c?

1199


Why can’t we compare structures?

1265


Differentiate between the expression “++a” and “a++”?

1247


What is the advantage of using #define to declare a constant?

1093


What is the size of structure in c?

1149


Do character constants represent numerical values?

1333