find a number whether it is even or odd without using any
control structures and relational operators?
Answer Posted / ruchi
#include<stdio.h>
#include<conio.h>
main()
{
int n;
char *p[]={"Even","odd"};
clrscr();
printf("Enter the number");
scanf("%d",&n);
n=n%2;
printf("The value is %s",p[n]);
getch();
}
Is This Answer Correct ? | 5 Yes | 1 No |
Post New Answer View All Answers
Write a program to generate the Fibinocci Series
Do you know what are bitwise shift operators in c programming?
Write a function which takes as parameters one regular expression(only ? and * are the special characters) and a string and returns whether the string matched the regular expression.
Can we declare variable anywhere in c?
Where are local variables stored in c?
What are local variables c?
stripos — Find position of first occurrence of a case- insensitive string int stripos ( char* haystack, char* needle, int offset ) Returns the numeric position of the first occurrence of needle in the haystack string. Note that the needle may be a string of one or more characters. If needle is not found, stripos() will return -1. The function should not make use of any C library function calls.
Write a code to achieve inter processor communication (mutual exclusion implementation pseudo code)?
GIVEN A FLOATING POINT NUMBER HOW IS IT ACTUALLY STORED IN MEMORY ? CAN ANYONE EXPLAIN?? THE 32 BIT REPRESENTATION OF A FLOATING POINT NUMBER ALLOTS: 1 BIT-SIGN 8 BITS-EXPONENT 23 BITS-MANTISSA
what is the different bitween abap and abap-hr?
Did c have any year 2000 problems?
How was c created?
Why do some versions of toupper act strangely if given an upper-case letter?
What was noalias and what ever happened to it?
Write the syntax and purpose of a switch statement in C.