write a c program to print a given number as odd or even
without using loop statements,(no if ,while etc)
Answer Posted / dr:rahul
#include<stdio.h>
#include<conio.h>
void main()
{
int rahul;
printf("0 - odd number \t 1 - even number\n");
printf("enter the number :");
scanf("%d",&rahul);
printf(" %d ",rahul&1);
getch();
}
| Is This Answer Correct ? | 4 Yes | 14 No |
Post New Answer View All Answers
What are the types of variables in c?
Can we access array using pointer in c language?
Explain why c is faster than c++?
Write a C/C++ program to add a user to MySQL. The user should be permitted to only "INSERT" into the given database.
What are the benefits of organizational structure?
can we implement multi-threads in c.
disply the following menu 1.Disply 2.Copy 3.Append; as per the menu do the file operations 4.Exit
How can I write functions that take a variable number of arguments?
What is meant by keywords in c?
What are lookup tables in c?
What is NULL pointer?
main() { struct s1 { char *str; struct s1 *ptr; }; static struct s1 arr[] = { {"Hyderabad",arr+1}, {"Bangalore",arr+2}, {"Delhi",arr} }; struct s1 *p[3]; int i; < BR> for(i=0;i<=2;i++) p[i] = arr[i].ptr; printf("%s ",(*p)->str); printf("%s ",(++*p)->str); printf("%s ",((*p)++)->str); }
What is the advantage of a random access file?
write a programe to accept any two number and check the following condition using goto state ment.if a>b,print a & find whether it is even or odd and then print.and a
Write a program to reverse a given number in c?