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

Answer Posted / shashi

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

}

Is This Answer Correct ?    11 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can I determine whether a machines byte order is big-endian or little-endian?

627


write a program that types this pattern: 12345678987654321 12345678 87654321 1234567 7654321 123456 654321 12345 54321 1234 4321 123 321 12 21 1 1

3299


What is the role of this pointer?

555


#include main() { char s[] = "Bouquets and Brickbats"; printf(" %c, ",*(&s[2])); printf("%s, ",s+5); printf(" %s",s); printf(" %c",*(s+2)); }

668


How can I get back to the interactive keyboard if stdin is redirected?

673






What is a keyword?

749


Please send me WIPRO technical question to my mail ID.. its nisha_g28@yahoo.com please its urgent

1659


What is wrong with this statement? Myname = 'robin';

828


2) Write a program that will help Air Traffic Control for an airport to view the sequence of flights ready for take-off. The airport can accommodate 10 flights waiting for take-off at any point in time. Each flight has a unique 3 digit numeric identifier.  Each time a flight takes-off, Air Traffic Control adds a flight to the waitlist. Each time a flight is added to the waitlist, the list of flights waiting to take-off must be displayed.  When a flight is cleared for take-off, Air Traffic Control removes the flight from the waitlist. Each time a flight takes-off, the list of flights waiting to take-off must be displayed.  Sequence of take-off is the sequence of addition to the waitlist

2521


The file stdio.h, what does it contain?

670


how many types of operators are include in c language a) 4 b) 6 c) 8 d) 12

656


What is main () in c language?

602


Explain the priority queues?

629


What do you mean by invalid pointer arithmetic?

637


What is C language ?

1533