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 is the height of tree if leaf node is at level 3. please explain
What is the use of getch ()?
Explain what is wrong with this program statement? Void = 10;
What is the benefit of using const for declaring constants?
Explain how do you sort filenames in a directory?
What is the auto keyword good for?
Why should I prototype a function?
application areas a 'c' a) operating system b) graphics, interpreter, assembler c) program evalution, communication softwares d) all the above
What is the benefit of using an enum rather than a #define constant?
Write a program to maintain student’s record. Record should
not be available to any unauthorized user. There are three
(3) categories of users. Each user has its own type. It
depends upon user’s type that which kind of operations user
can perform. Their types and options are mentioned below:
1. Admin
(Search Record [by Reg. No or Name], View All Records,
Insert New Record, Modify Existing Record)
2. Super Admin
(Search Record [by Reg. No or Name], View All Records,
Insert New Record, Modify Existing Record, Delete Single Record)
3. Guest
(Search Record [by Reg. No or Name], View All Records)
When first time program runs, it asks to create accounts.
Each user type has only 1 account (which means that there
can be maximum 3 accounts). In account creation, following
options are required:
Login Name: <6-10 alphabets long, should be unique>
Password: <6-10 alphabets long, should not display
characters when user type>
Confirm Password:
How do you convert strings to numbers in C?
Differentiate between full, complete & perfect binary trees.
write a c program to calculate sum of digits till it reduces to a single digit using recursion
What is New modifiers?
What is #define in c?