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 to implement a packet in C

2932


What is the process to generate random numbers in c programming language?

1220


How can I do serial ("comm") port I/O?

1217


all c language question

2490


Why do we use namespace feature?

1121


What are the different types of endless loops?

1128


a character or group of characters that defines a register,or a part of storage a) memory b) byte c) address d) linear list

1050


Why is c fast?

1119


What are the 4 types of unions?

1089


What is f'n in math?

1142


what is the differnce between programing langauge and tool? is sas is a programing langauge r tool?

2462


What are extern variables in c?

1037


Write a c program to build a heap method using Pointer to function and pointer to structure ?

4751


Difference between pass by reference and pass by value?

1210


What are the 4 types of organizational structures?

1161