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
What do you understand by friend-functions? How are they used?
What is difference between static and global variable in c?
Explain what math functions are available for integers? For floating point?
Is c procedural or functional?
What is the description for syntax errors?
.find the output of the following program? char*myfunc(char*ptr) { ptr +=3; return (ptr); } int main() { char*x,*y; x="HELLO"; y=myfunc(x); printf("y = %s ",y); return 0; }
What are pointers? What are stacks and queues?
What is an auto variable in c?
How can I read a binary data file properly?
What are different types of operators?
Where local variables are stored in c?
write a program to print data of 5 five students with structures?
Is malloc memset faster than calloc?
Explain the priority queues?
`write a program to display the recomended action depends on a color of trafic light using nested if statments