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 / rohit agarwal

#include<stdio.h>
#include<conio.h>
main()
{
int n;
char *p[]={"Even","odd"};
clrscr();
printf("Enter the number");
scanf("%d",&n);
n=n%2;
printf("The value is %s",p[n]);
getch();

Is This Answer Correct ?    1 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is the basis for selection of arrays or pointers as data structure in a program

4345


hi, which software companys will take,if d candidate's % is jst 55%?

2140


What is function pointer c?

1192


What is a struct c#?

1108


What is the scope of global variable in c?

1040


When we use void main and int main?

1131


What is signed and unsigned?

1127


What does it mean when a pointer is used in an if statement?

1159


What is the value of a[3] if integer a[] = {5,4,3,2,1}?

1148


What will be the outcome of the following conditional statement if the value of variable s is 10?

1375


int main() { Int n=20,i; For(i=0;i<=n;i--) { Printf(“-“); Return 0;

1934


How do you use a pointer to a function?

1151


What is pre-emptive data structure and explain it with example?

3791


What is the difference between arrays and pointers?

1177


Is c dynamically typed?

1214