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

Answer Posted / avinash kumar

#include<stdio.h>
main()
{
int a;
clrscr();
printf("enter a number:");
scanf("%d",&a);
if(a%2=0)
printf("even");
else
printf("odd")
getch();
}

Is This Answer Correct ?    25 Yes 22 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the scope of static variables?

844


What is the scope of static variable in c?

733


What are multibyte characters?

862


What is the right way to use errno?

836


What does 3 periods mean in texting?

827


What are external variables in c?

786


Can we declare variables anywhere in c?

778


Write a program to reverse a string.

853


write an algorithm to display a square matrix.

2453


Why we use break in c?

767


how to introdu5ce my self in serco

1741


What are volatile variables in c?

706


which is conditional construct a) if statement b) switch statement c) while/for d) goto

1002


Can I initialize unions?

827


How to write a code for reverse of string without using string functions?

1842