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

Which is better oop or procedural?

1071


Why clrscr is used in c?

1017


What is floating point constants?

1138


Explain what is page thrashing?

1101


Where is c used?

1096


What is scope and lifetime of a variable in c?

1074


Write a program for finding factorial of a number.

1089


Write programs for String Reversal & Palindrome check

1062


What is storage class?

1079


How do I get a null pointer in my programs?

1115


How can I change the size of the dynamically allocated array?

1151


What is far pointer in c?

1315


Which one would you prefer - a macro or a function?

1087


How will you divide two numbers in a MACRO?

1141


What does != Mean in c?

1055