Write a program to find the given number is odd or even
without using any loops(if,for,do,while)
Answers were Sorted based on User's Feedback
Answer / kiran
main()
{
int n;
printf("enter the number");
scanf("%d",&n);
n%2==0?(printf("given number is even");):(printf("given
number is odd"););
| Is This Answer Correct ? | 8 Yes | 3 No |
#include<stdio.h>
int main()
{
int i;
printf("enter a number \n");
scanf("%d",i);
float f=i%2;
f==0 ? printf("given number is even") : printf("given
number is odd");
return 0;
}
| Is This Answer Correct ? | 3 Yes | 1 No |
How can I find out if there are characters available for reading?
int i=10; printf("%d %d %d", i, i=20, i);
Why is struct padding needed?
What does a pointer variable always consist of?
#include <stdio.h> #define sqr(x) (x*x) int main() { int x=2; printf("value of x=%d",sqr(x+1)); } What is the value of x?
16 Answers Accel Frontline, Opera, Oracle,
write a c program to find the largest and 2nd largest numbers from the given n numbers without using arrays
Is there any book to know about Basics of C Language?
Explain what is the best way to comment out a section of code that contains comments?
What do you mean by keywords in c?
What is the difference between GETS();AND SCANF();
ABCDCBA ABC CBA AB BA A A
Explain what would happen to x in this expression: x += 15; (assuming the value of x is 5)