find a number whether it is even or odd without using any
control structures and relational operators?
Answer Posted / d.c.sathishkumar
#include<stdio.h>
main()
{
int n;
char *p[]={"Even","odd"};
Printf("Enter the number");
scanf("%d",&n);
n=n%2;
printf("The value is %s",a[n]);
}
Is This Answer Correct ? | 17 Yes | 8 No |
Post New Answer View All Answers
What is dynamic memory allocation?
What is merge sort in c?
What is the use of linkage in c language?
What is the difference between far and near in c?
Can stdout be forced to print somewhere other than the screen?
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
a way in which a pointer stores the address of a pointer which stores the value of the target value a) reference b) allocation c) multiple indirection d) none
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.
An arrangement of information in memory in such a way that it can be easily accessed and processed by a programming language a) string b) data structure c) pointers d) array
Explain what are the different data types in c?
What is the usage of the pointer in c?
Why array is used in c?
How many data structures are there in c?
What does void main return?
Differentiate between a structure and a union.