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

Write a C program to count the number of email on text

1871


In a switch statement, explain what will happen if a break statement is omitted?

1012


What are pointers? Why are they used?

1130


What is the easiest sorting method to use?

1118


When should volatile modifier be used?

970


Can a file other than a .h file be included with #include?

1113


What is the purpose of sprintf() function?

1073


What are variables c?

1008


What’s a signal? Explain what do I use signals for?

1068


what are bit fields in c?

1622


What is a far pointer in c?

1005


Is c object oriented?

923


How do you determine a file’s attributes?

1032


What is a pointer in c?

1458


Is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?

1051