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 / ramesh

#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 ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is pointers in c?

1124


What is #ifdef ? What is its application?

1114


Why do we use null pointer?

1075


What is #include conio h?

1012


How to delete a node from linked list w/o using collectons?

2788


typedef struct{ char *; nodeptr next; } * nodeptr ; What does nodeptr stand for?

1651


List some basic data types in c?

1034


What is the size of structure in c?

1161


program to find error in linklist.(i.e find whether any node point wrongly to previous nodes instead of next node)

2109


Which are low level languages?

1104


Explain how can you avoid including a header more than once?

1098


What is meant by operator precedence?

1156


How can I rethow can I return a sequence of random numbers which dont repeat at all?

1192


Explain modulus operator. What are the restrictions of a modulus operator?

1022


c program to compute AREA under integral

2414