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

Answer Posted / satyanarayana

#include<stdio.h>
void main()
{
int p;
printf("number:");
scanf("%d",&p);
while(p%2)
{
printf("odd");
}
printf("even");
}

Is This Answer Correct ?    2 Yes 10 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can 'this' pointer by used in the constructor?

614


Explain what is a 'locale'?

585


Why isnt there a numbered, multi-level break statement to break out

587


why do some people write if(0 == x) instead of if(x == 0)?

654


What are c identifiers?

629






How can I read a binary data file properly?

635


Calculate 1*2*3*____*n using recursive function??

1517


When should a type cast not be used?

627


List the difference between a 'copy constructor' and a 'assignment operator' in C?

637


What are the features of c language?

621


Why is a semicolon (;) put at the end of every program statement?

628


What is the purpose of & in scanf?

598


What is cohesion and coupling in c?

591


design and implement a data structure and performs the following operation with the help of file (included 1000 student marks in 5 sub. and %also) 1.how many students are fail in all 5 subjects (if >35) 2. delete all student data those are fail in all 5 subjects. 3. update the grace marks (5 no. if exam paper is 100 marks) 4. arrange the student data in ascending order basis of marks. 5.insert double of deleted students with marks in the list.

1497


Is boolean a datatype in c?

546