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 / p.thirugnanavel

#include<stdio.h>
#include<conio.h>
void main()
{
int no,ch;
clrscr();
printf("enter the number :");
scanf("%d",&no);
ch=(no%2==0) ? (1) : (2);
switch(ch)
{
case 1:
printf("The number %d is even",no);
break;
case 2:
printf("The number %d is odd",no);
break;
}
getch();
}

Is This Answer Correct ?    7 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What will be your course of action for a push operation?

1049


What’s the special use of UNIONS?

1105


What is union in c?

1059


What is header file definition?

1023


Can we use visual studio for c?

1008


What is wild pointer in c with example?

1018


What is the importance of c in your views?

1090


how is the examination pattern?

1961


What does a function declared as pascal do differently?

1039


Explain 'bus error'?

1013


Explain the process of converting a Tree into a Binary Tree.

2607


What is the use of typedef in c?

989


How can I check whether a file exists? I want to warn the user if a requested input file is missing.

1084


Explain what is the difference between far and near ?

1047


Explain what are the standard predefined macros?

1070