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
You can do it without using if even
#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 [ x &
0x1 ] );
return ( 0 );
}
| Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
What are qualifiers in c?
Differentiate fundamental data types and derived data types in C.
any "C" function by default returns an a) int value b) float value c) char value d) a & b
Explain the use of 'auto' keyword
What is c language used for?
Why is c faster?
What is the difference between printf and scanf in c?
What is || operator and how does it function in a program?
How can variables be characterized?
What is the collection of communication lines and routers called?
The process of repeatedly running a set of computer instructions until some condition is specifed a) condition b) sequential condition c) global d) iteration
How can I split up a string into whitespace-separated fields?
Hai,I have done with my bachelor of commerce and planing to ms,please suggest me how to convince vo for shifting from commerce to computers. Visa on 8 DEC 2014 Npu university
What does the c in ctime mean?
How can my program discover the complete pathname to the executable from which it was invoked?