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

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

}

Is This Answer Correct ?    11 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the difference between ++u and u++?

1187


What are compound statements?

1239


which of the following statement is wrong a) mes=123.56; b) con='T'*'A'; c) this='T'*20; d) 3+a=b;

3330


Write a code to determine the total number of stops an elevator would take to serve N number of people.

1309


What is self-referential structure in c programming?

1280


What is the meaning of 2d in c?

1166


Is calloc better than malloc?

1075


How can I find out the size of a file, prior to reading it in?

1225


How can I trap or ignore keyboard interrupts like control-c?

1116


Explain pointer. What are function pointers in C?

1145


What is the significance of an algorithm to C programming?

1094


Can a function argument have default value?

1206


Compare array data type to pointer data type

1083


Explain can static variables be declared in a header file?

1197


Explain what is the purpose of "extern" keyword in a function declaration?

1125