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...

find a number whether it is even or odd without using any
control structures and relational operators?

Answer Posted / ramesh

#include<stdio.h>
#include<conio.h>
main()
{
int n;
char *p[]={"Even","odd"};
clrscr();
printf("Enter the number");
scanf("%d",&n);
n=n%2;
printf("The value is %s",p[n]);
getch();

}

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

One of the Institutes contains 5 student groups. Every group contains 4 students. Institute wants to store student group’s details in array. Group should contain group member’s details (name and registration number and age), project name, and mark of the group.

2598


Explain the difference between call by value and call by reference in c language?

1073


Explain how can I pad a string to a known length?

1146


Explain pointer. What are function pointers in C?

1032


What is formal argument?

1100


What is extern storage class in c?

956


Is it possible to initialize a variable at the time it was declared?

1194


What is the difference between scanf and fscanf?

1216


What is the right way to use errno?

1015


Explain what is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?

1054


Write a code to achieve inter processor communication (mutual exclusion implementation pseudo code)?

1090


Explain the use of keyword 'register' with respect to variables.

986


What are valid signatures for the Main function?

1190


the maximum length of a character constant can be a) 1 character b) 8 characters c) 256 chaacters d) 125 characters

2255


List some applications of c programming language?

916