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

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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is %s and %d in c?

987


Should a function contain a return statement if it does not return a value?

1034


Is null valid for pointers to functions?

1120


the 'sizeof' operator reported a larger size than the calculated size for a structure type. What could be the reason?

959


What are c preprocessors?

1134


What is structure of c program?

1096


What are the two types of structure?

1047


What are the different types of errors?

1084


What is the symbol indicated the c-preprocessor?

1178


When is a null pointer used?

1070


How the c program is executed?

1093


When a c file is executed there are many files that are automatically opened what are they files?

1065


How do you determine a file’s attributes?

1028


Differentiate between a for loop and a while loop? What are it uses?

1147


Is it possible to have a function as a parameter in another function?

1045