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

Answer Posted / mohd parvez 09311349697

#include<stdio.h>
#include<conio.h>
void main()
{
int num;
printf("Enter a number:");
scanf("%d",&num);
num%2&&printf("Number is ODD")||printf("Number is EVEN");
getch();
}

Is This Answer Correct ?    1 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can math operations be performed on a void pointer?

587


Write a program to print all permutations of a given string.

644


What are register variables in c?

575


How to write a program for machine which is connected with server for that server automatically wants to catch the time for user of that machine?

1591


how to find anagram without using string functions using only loops in c programming

2718






What are header files and explain what are its uses in c programming?

612


Why main function is special give two reasons?

948


Write a program with dynamically allocation of variable.

604


Do pointers need to be initialized?

562


pgm to find any error in linklist(in single linklist check whether any node points any of previous nodes instead of next node)

2201


Can static variables be declared in a header file?

618


In c language can we compile a program without main() function?

580


Write a program to display all the prime nos from 1 to 1000000, your code should not take time more than a minute to display all the nos.

1593


Explain what’s a signal? Explain what do I use signals for?

612


Differentiate between declaring a variable and defining a variable?

607