0% found this document useful (0 votes)
4 views1 page

Week3 Assignment

The document outlines a lab assignment for BTech-I Semester students in the Computer Science & Engineering department at Motilal Nehru National Institute of Technology, Allahabad. It includes tasks related to conditional statements, loops, and switch cases, such as determining leap years, grading students based on scores, reversing digits of integers, checking for prime numbers, printing ASCII values, creating a simple calculator, and calculating factorials. Each task aims to enhance programming skills in C language.

Uploaded by

gv780601
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views1 page

Week3 Assignment

The document outlines a lab assignment for BTech-I Semester students in the Computer Science & Engineering department at Motilal Nehru National Institute of Technology, Allahabad. It includes tasks related to conditional statements, loops, and switch cases, such as determining leap years, grading students based on scores, reversing digits of integers, checking for prime numbers, printing ASCII values, creating a simple calculator, and calculating factorials. Each task aims to enhance programming skills in C language.

Uploaded by

gv780601
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

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.

You might also like