Professional Documents
Culture Documents
Write a program to check whether a number is even or odd using bitwise operator
2. Write a program to check whether two numbers are equal or not using bitwise operator.
3. WAP to exchange two integers with or without using third variable. ( a = a+b; b=a-b;
a=a-b; )
4. Write a program to check whether a number is even or odd
5. The current year and the year in which the employee joined the organization are entered
through the keyboard. If the number of years for which the employee has served the
organization is greater than 3 then a bonus of Rs. 2500/- is given to the employee. If the
years of service are not greater than 3, then the program should do nothing.
6. In a company an employee is paid as under:
If his basic salary is less than Rs. 1500, then HRA = 10% of basic salary and DA = 90% of
basic salary. If his salary is either equal to or above Rs. 1500, then HRA = Rs. 500 and DA
= 98% of basic salary. If the employee's salary is input through the keyboard write a
program to find his gross salary.
7. Write a 'C' program to find the sum of the first n even natural numbers by using the
formula - n(n+1)
Hint sum =n *(n+1);
8. Rajat has appeared for End Term exam for “ C programming” Subject. He wants to know
his grade in the subject as per marks obtained by him. The grade depends upon marks
obtained as per below mentioned criteria:
Marks Grade
>= 75 Distinction
>= 60 and <75 First division
>=50 and <60 Second division
>=40 and <50 Third division
<40 Fail
write a program to help Rajat to automate this process of calculating the Grade.
9. The Air Quality Index (AQI) shows the levels of health concerns for a particular area. The
level of air quality for a given AQI is mentioned as below:
AQI (Air Quality Level of Air Quality
Index)
>0 and <=50 Healthy
>50 and <=100 Moderate
>100 and <=200 Unhealthy
>200 and <=300 Very Unhealthy
>300 and <=500 Hazardous
10. Write a 'C' program to accept the month number and print the month name using switch-
case
11. Write a 'C' program to accept input and print whether the given input is a character, digit,
or special symbol using a switch-case.
ASCII Value
A –Z (65 – 90) capital
a-z (97-122) small
Digits (48-57)
12. Write a 'C' program to find whether the given year is a Leap year.
A leap year is exactly divisible by 4 except for century years (years ending with 00). The
century year is a leap year only if it is perfectly divisible by 400.