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 program to find given number is even or odd without
using any control statement.

Answers were Sorted based on User's Feedback



Write a program to find given number is even or odd without using any control statement...

Answer / rani

#include<stdio.h>
#include<conio.h>
void main()
{
char str[][10]={"even","odd"};
int no;
clrscr();
printf("\nEnter a number...");
scanf("%d",&no);
printf("\n%d is %s",no,str[no%2]);
getch();
}

Is This Answer Correct ?    13 Yes 1 No

Write a program to find given number is even or odd without using any control statement...

Answer / saneemask

main()
{

{
char a[][5]= {"Even","Odd"};
int n;
printf("Enter any no.: ");
scanf("%d",&n);
printf("%s",a[n%2]);
getch();
}
{

Is This Answer Correct ?    3 Yes 0 No

Post New Answer

More C Interview Questions

sum of two integers values only other then integer it should print invalid input.

1 Answers  


errors in computer programmes are called

1 Answers   NET,


Tell me can the size of an array be declared at runtime?

0 Answers  


int main(){ float f=8.0; if(f==8.0) printf("good"); else printf("bad"); } what is the answere and explain it?

3 Answers  


Explain how do you convert strings to numbers in c?

0 Answers  


Create a simple code fragment that will swap the values of two variables num1 and num2.

0 Answers  


How do you redirect a standard stream?

0 Answers  


void main() { int a=1; while(a++<=1) while(a++<=2); }

4 Answers   HCL,


What are file streams?

0 Answers  


Is double link list a linear data structure? If Yes, Why?If No, Why?

4 Answers  


main() { int a=0; if(a=0) printf("Ramco Systems\n"); printf("India\n"); } output?

7 Answers   Ramco,


What is the mean of function?

0 Answers  


Categories