write a c program to print a given number as odd or even
without using loop statements,(no if ,while etc)

Answer Posted / vignesh1988i

#include<stdio.h>
#include<conio.h>
void main()
{
int m;
printf("0 - odd number \t 1 - even number\n");
printf("enter the number :");
scanf("%d",&m);
printf(" %d ",m&1);
getch();
}


thank u

Is This Answer Correct ?    43 Yes 27 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Are pointers integers in c?

609


What are reserved words with a programming language?

599


What are the types of operators in c?

610


What are the valid places to have keyword “break”?

647


why programs in c are running with out #include? some warnings are display in terminal but we execute the program we get answer why? eg: main() { printf("hello world "); }

1314






a sequence of bytes with one to one corrspondence to those in the external device a) sequential addressing b) address c) byte code d) none

717


using only #include and #include Write a program in C that will read an input from the user and print it back to the user if it is a palindrome. The string ends when it encounters a whitespace. The input string is at most 30 characters. Assume the string has no spaces and distinguish between and lowercase. So madam is a palindrome, but MadAm is not a palindrome. Use scanf and %s to read the string. Sample Test: Enter a string: madam madam is a palindrome. Enter a string: 09023 09023 is not a palindrome.

1308


What are the two forms of #include directive?

640


What is nested structure with example?

620


Write a program, where i have a grid with many cells, how many paths are possible from one point to other desired points.

699


Explain how do you view the path?

649


Why main function is special give two reasons?

942


What is unsigned int in c?

551


What the advantages of using Unions?

669


What is bash c?

554