Write a program to find given number is even or odd without
using any control statement.
Answer Posted / rani
#include<stdio.h>
#include<conio.h>
void main()
{
char str[][10]={"even","odd"};
int no;
clrscr();
printf("\nEnter a number...");
scanf("%d",&no);
printf("\n%d is %s",no,str[no%2]);
getch();
}
Is This Answer Correct ? | 13 Yes | 1 No |
Post New Answer View All Answers
What does 3 mean in texting?
What is the difference between functions abs() and fabs()?
pgm to find number of words starting with capital letters in a file(additional memory usage not allowed)(if a word starting with capital also next letter in word is capital cann't be counted twice)
What is an arrays?
What is wrong with this code?
What is c definition?
Why is sprintf unsafe?
What are the types of type specifiers?
a value that does not change during program execution a) variabe b) argument c) parameter d) none
Write a program to print “hello world” without using semicolon?
what is diffrence between linear and binary search in array respect to operators?what kind of operator can be used in both seach methods?
What is the difference between malloc() and calloc()?
What is pragma in c?
What is external variable in c?
Write a program to print ASCII code for a given digit.