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...

To find whether a number is even or odd without using any
conditional operator??

Answer Posted / jai gomathi

/*PROGRAM BY JAI GOMATHI.NS, B.E.*/
#include<stdio.h>
#include<conio.h>
void main()
{
int n;
char a["oddnumber","evennumber"];
printf("\nEnter a number: ");
scanf("%d",&n);
printf("%s",a[n%2]); //when odd, a[1] will print odd number
getch();
}

Is This Answer Correct ?    9 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why double pointer is used in c?

1088


any limit on the number of functions that might be present in a C program a) max 35 functions b) max 50 functions c) no limit d) none of the above

1102


What is a volatile keyword in c?

1212


What is an array in c?

1097


What is the most efficient way to count the number of bits which are set in an integer?

1120


The postoder traversal is 7,14,3,55,22,5,17 Then ur Inorder traversal is??? please help me on this

3656


a program that performs some preliminary processing in C, it acts upon certain directives that will affect how the compiler does its work a) compiler b) loader c) directive d) preprocessor

1149


Explain two-dimensional array.

1129


What are logical errors and how does it differ from syntax errors?

1349


How many identifiers are there in c?

1083


How can I read in an object file and jump to locations in it?

1071


Describe the header file and its usage in c programming?

1105


Do you have any idea about the use of "auto" keyword?

1131


What will the code below print when it is executed?   int x = 3, y = 4;         if (x = 4)                 y = 5;         else                 y = 2;         printf ("x=%d, y=%d ",x,y);

1945


a c code by using memory allocation for add ,multiply of sprase matrixes

2862