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 / vishal jain

#include<stdio.h>
#include<conio.h>
int main()
{
int num,i;
printf("Enter any Number : \n");
scanf("%d",&num);
i=num&1;
if(i==1)
{
printf("ODD");
}
else
{
printf("EVEN");
}
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

What is a structure and why it is used?

1135


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

1523


How can I read and write comma-delimited text?

1010


Compare and contrast compilers from interpreters.

1074


What is cohesion in c?

923


Describe the order of precedence with regards to operators in C.

1002


Write a program to check whether a number is prime or not using c?

1009


Can static variables be declared in a header file?

1003


Write a program to display all the prime nos from 1 to 1000000, your code should not take time more than a minute to display all the nos.

2008


What is sorting in c plus plus?

926


exit () is used to a) exit () terminates the execution of the program itself b) exit () terminates the execution of the loop c) exit () terminates the execution of the block d) none of the above

1070


What is the difference between a function and a method in c?

1034


What is the difference between malloc() and calloc()?

1692


What is meant by initialization and how we initialize a variable?

1004


Program to find the sum of digits of a given number until the sum becomes a single digit. (e.g. 12345=>1+2+3+4+5=15=>1+5=6)

1099