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

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

}

Is This Answer Correct ?    13 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can I remove the leading spaces from a string?

1155


What is array in c with example?

1245


What's a good way to check for "close enough" floating-point equality?

1156


How do you print only part of a string?

1015


Does c have an equivalent to pascals with statement?

995


What do you understand by friend-functions? How are they used?

1204


In C programming, what command or code can be used to determine if a number of odd or even?

1049


What are the benefits of organizational structure?

1019


Explain the difference between exit() and _exit() function?

1165


What is the use of in c?

1025


What is an lvalue?

1063


Explain what is wrong with this statement? Myname = ?robin?;

1566


Is there sort function in c?

1010


You are to write your own versions of strcpy() and strlen (). Call them mystrcpy() and mystrlen(). Write them first as code within main(), not as functions, then, convert them to functions. You will pass two arrays to the function in the case of mystrcpy(), the source and target array.

2330


What are the 4 types of unions?

1034