Write a program to find the given number is odd or even
without using any loops(if,for,do,while)

Answer Posted / ramu gurram

#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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain what are run-time errors?

601


write a program which the o/p should b in such a way that s triangle if I/p is 3,a Square/rectangle if I/P=4,a pentagon if I/P=5 and so on...forget about the I/P which is less than 3

1633


Tell us bitwise shift operators?

588


How will you declare an array of three function pointers where each function receives two ints and returns a float?

768


Can a variable be both constant and volatile?

551






What is infinite loop?

619


what is the basis for selection of arrays or pointers as data structure in a program

3780


formula to convert 2500mmh2o into m3/hr

487


How many data structures are there in c?

607


I have seen function declarations that look like this

587


Explain the difference between strcpy() and memcpy() function?

582


Why can’t constant values be used to define an array’s initial size?

823


What are enumerated types?

644


Define C in your own Language.

628


What is an example of structure?

580