MOTILAL NEHRU NATIONAL INSTITUTE OF TECHNOLOGY
ALLAHABAD
Department of Computer Science & Engineering
BTech-I Semester
Computer Programming (CSN11101)
Lab Assignment -3
Conditional Statements
1. Write a program to find if a year is leap year or not . a) Use &&, || operators. B) Without
&&,|| operator.
2. Write a program to print the grade of a student according to the score. where A+ for 85 or
above, A for 75 to 84, B+ for 65 to 74, B for 50 to 64, C for 30 to 49 and fail below 30.
Loops and Switch
3. Write a program to reverse the digits of an integer.
4. Write a program to check if a given number is prime.
5. Write a program to print all ASCII values and their equivalent characters.
6. Write a program for simple calculator using switch case in C
7. Write a program to find the factorial value of any number entered through the keyboard.