find a number whether it is even or odd without using any
control structures and relational operators?
Answer Posted / ramesh
#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 ? | 3 Yes | 1 No |
Post New Answer View All Answers
One of the Institutes contains 5 student groups. Every group contains 4 students. Institute wants to store student group’s details in array. Group should contain group member’s details (name and registration number and age), project name, and mark of the group.
Explain the difference between call by value and call by reference in c language?
Explain how can I pad a string to a known length?
Explain pointer. What are function pointers in C?
What is formal argument?
What is extern storage class in c?
Is it possible to initialize a variable at the time it was declared?
What is the difference between scanf and fscanf?
What is the right way to use errno?
Explain what is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?
Write a code to achieve inter processor communication (mutual exclusion implementation pseudo code)?
Explain the use of keyword 'register' with respect to variables.
What are valid signatures for the Main function?
the maximum length of a character constant can be a) 1 character b) 8 characters c) 256 chaacters d) 125 characters
List some applications of c programming language?