find a number whether it is even or odd without using any
control structures and relational operators?
Answer Posted / gganesh
#include<stdio.h>
#include<conio.h>
void main()
{
int n;
clrscr();
printf("Enter the number : ");
scanf("%d",&n);
n%2?printf("Odd"):printf("Even");
getch();
}
note: here i used conditional operator, not a relational
operators and control structures
Is This Answer Correct ? | 3 Yes | 1 No |
Post New Answer View All Answers
Write a factorial program using C.
What are the advantages and disadvantages of pointers?
What are operators in c?
Why can’t we compare structures?
a) Identify the following declarations. Ex. int i (integer variable) float a[l0](array of 10 real nos) int (*f())() void *f int (*f()) [] void *f int f[] [] [] char *(*f) () int (*f[]) [] float(*f) [] [] float **f int ******f
How can you determine the maximum value that a numeric variable can hold?
What does typedef struct mean?
How can you convert integers to binary or hexadecimal?
What are valid operations on pointers?
Is c procedural or functional?
What is strcmp in c?
What is the mean of function?
Differentiate Source Codes from Object Codes
Explain what is the benefit of using an enum rather than a #define constant?
Hai sir, I had planned to write the NIC scientific engineer exam , plz post the sample question......