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


Please Help Members By Posting Answers For Below Questions

How many bytes is a struct in c?

722


Is it better to bitshift a value than to multiply by 2?

654


Explain what is the difference between functions abs() and fabs()?

613


How do you view the path?

662


Can we access the array using a pointer in c language?

556






What is the scope of static variable in c?

532


Is the exit() function same as the return statement? Explain.

656


How to get string length of given string in c?

605


Explain the Difference between the New and Malloc keyword.

684


what are the different storage classes in c?

660


What is the hardest programming language?

663


C program execution always begins with a) #include b) comment (/*-------*/) c) main() d) declaration instructions

606


Explain how do you determine the length of a string value that was stored in a variable?

666


write a program to print largest number of each row of a 2D array

1866


What is array of structure in c programming?

747