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 / sanju uthaiah

#include<stdio.h>

int main()
{
char result[2]={"Even","Odd"};
int n=40;
printf("%d is %s",n,result[n%2]);
return 0;
}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How does placing some code lines between the comment symbol help in debugging the code?

941


explain what are actual arguments?

1032


What is the difference between near, far and huge pointers?

1032


Explain how are portions of a program disabled in demo versions?

1073


Is javascript written in c?

1015


What are the different types of control structures in programming?

1085


What is this infamous null pointer, anyway?

988


why to assign a pointer to null sometimes??how can a pointer we declare get assigned with a garbage value by default???

1913


please explain clearly about execution of c program in detail,in which stage are the printf sacnf getting into exeecutable code

2131


#define PRINT(int) printf("int = %d ",int) main() {< BR> intx,y,z; x=03;y=02;z=01; PRINT(x^x); z<<=3;PRINT(x); y>>=3;PRINT(y); }

1129


Why is structure important for a child?

1049


Can you pass an entire structure to functions?

1078


Write a C Program That Will Count The Number Of Even And Odd Integers In A Set using while loop

2107


When should structures be passed by values or by references?

995


What are pragmas and what are they good for?

936