0% found this document useful (0 votes)
19 views3 pages

Week2 (Lab 3&lab 4)

The document outlines the lab exercises for the Programming for Problem Solving using C course, focusing on decision statements in C programming. It includes tasks such as determining voting eligibility, checking even or odd numbers, calculating differences, and identifying leap years. Additional exercises involve conditional printing based on variable values, finding the greatest of two numbers, calculating payment options based on tuition fees, and validating triangle sides.

Uploaded by

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

Week2 (Lab 3&lab 4)

The document outlines the lab exercises for the Programming for Problem Solving using C course, focusing on decision statements in C programming. It includes tasks such as determining voting eligibility, checking even or odd numbers, calculating differences, and identifying leap years. Additional exercises involve conditional printing based on variable values, finding the greatest of two numbers, calculating payment options based on tuition fees, and validating triangle sides.

Uploaded by

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

SCHOOL OF ENGINEERING

Department of Computer Science & Technology

Course: [Link]. CSE/AIML/CSTI/FSD/R&AI Semester: I

Subject: Programming for Problem solving using C (CSH102C)

WEEK-2
LAB: 03

Course Outcomes: CSH102C.1: To demonstrate programming skills for solving elementary


problems.

Blooms Taxonomy Level: BT1, BT2

Learning Objective: Aim: Students will be able to handle to implement and analyze basic
concepts based on decision statements used in C programming language

1. Write a program in C to determine whether a person is eligible to vote or not


based on his age.

2. Write a program in C to find whether the given number is even or odd.

3. Write a program to accept 2 numbers. Calculate the difference between the two
values. If the difference is equal to any of the values entered, then display the
following message: Difference is equal to value If the difference is not equal to any
of the values entered, display the following message: Difference is not equal to
any of the values entered

4. Write a program to find whether a given year is a leap year or not.


LAB: 04

Course Outcomes: CSH102C.1: To demonstrate programming skills for solving elementary


problems.

Blooms Taxonomy Level: BT1, BT2,BT3

Learning Objective: Aim: Students will be able to handle to implement and analyze basic
concepts based on decision statements used in C programming language

1. Declare two variables x and y. Assign values to these variables. Number x should be
printed only if it is less than 2000 or greater than 3000, and number y should be
printed only if it is between 100 and 500.

2. Write a program to print the greatest of two numbers using conditional operators.

3. Write a program which displays the following output on the basis of inputted Mode
Of Payment and Tuition fees. Mode of payment can be 1, 2 or 3.
Mode Action
1 - Cash 10% Discount
2 - Two-Installment 5% Interest
3 - Three-Installment 10% Interest
Sample Outputs:
Enter Your Tuition Fee: 20000
Choose Mode of Payment: 1
The Amount of Payment: Rs. 18000

Enter Your Tuition Fee: 20000


Choose Mode of Payment: 2
The Amount of Payment: Two installments of Rs.10500 each

Enter Your Tuition Fee: 20000


Choose Mode of Payment: 3
The Amount of Payment: Three installments of Rs.7333.33 each

4. Write a program to accept the three sides of a triangle and determine whether they
form a valid triangle.

You might also like