Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

What are the types of variables in c?

978


Can we access array using pointer in c language?

1040


Explain why c is faster than c++?

1004


Write a C/C++ program to add a user to MySQL. The user should be permitted to only "INSERT" into the given database.

1922


What are the benefits of organizational structure?

972


can we implement multi-threads in c.

1086


disply the following menu 1.Disply 2.Copy 3.Append; as per the menu do the file operations 4.Exit

2017


How can I write functions that take a variable number of arguments?

1075


What is meant by keywords in c?

1035


What are lookup tables in c?

950


What is NULL pointer?

1039


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); }

1360


What is the advantage of a random access file?

1128


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

1884


Write a program to reverse a given number in c?

979