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

what is the other ways to find a logic to print whether a
number is an even or odd wit out using % symbol??????? i
know three different ways to print it. so i need any other
different logic>>>>>

Answer Posted / abdur rab

Sorry i forgot to change the variable name. this ud work

#include <stdio.h>

int main ( int argc, char* argv[] )
{
int _number;
char _value[2][5]={"EVEN", "ODD"};
printf( "Enter an ineteger :" );
scanf( "%d", &_number );
printf( "\nThe given number is :%s", _value [
_number &
0x1 ] );
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 advantage of pointer in c?

1122


Do you know the difference between malloc() and calloc() function?

1005


Explain bitwise shift operators?

1171


Write a program that takes a 5 digit number and calculates 2 power that number and prints it(should not use big integers and exponential functions)

6727


What is the purpose of main( ) in c language?

1090


Explain what is the difference between a free-standing and a hosted environment?

1126


What is a macro in c preprocessor?

1051


What is a void * in c?

1021


write a c program thal will find all sequences of length N that produce the sum is Zero, print all possible solutions?

2813


What are pointers in C? Give an example where to illustrate their significance.

1167


What is the difference between call by value and call by reference in c?

1115


Why is not a pointer null after calling free?

970


What is pragma in c?

1130


cin.ignore(80, _ _);This statement a) ignores all input b) ignores the first 80 characters in the input c) ignores all input till end-of-line d) iteration

1055


How do you do dynamic memory allocation in C applications?

1045