0% found this document useful (0 votes)
5 views

Assignment1

The document outlines the first assignment for the Computer Lab (CS 1271) due on January 9, 2024, which includes multiple programming tasks in C. Students are required to complete the programs during lab and submit their codes in a single PDF with personal details before the next lab session. The tasks involve multiplying numbers, calculating the area of a triangle, computing the area and circumference of a circle, converting temperatures, and evaluating mathematical expressions.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Assignment1

The document outlines the first assignment for the Computer Lab (CS 1271) due on January 9, 2024, which includes multiple programming tasks in C. Students are required to complete the programs during lab and submit their codes in a single PDF with personal details before the next lab session. The tasks involve multiplying numbers, calculating the area of a triangle, computing the area and circumference of a circle, converting temperatures, and evaluating mathematical expressions.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Computer Lab (CS 1271)

Assignment: 1

• Work out all programs and report the outputs during the lab class of 09-Jan-2024.
• If the assignment sheet is not complete, do the rest as homework.
• Put all your codes in a single pdf to upload in the Google Classroom before the
next day’s lab. Write your name, department, enrollment number, group number
on a top sheet.

1. Write a C program to multiply three numbers and print the result. Here two
numbers have to be taken through assignment statements and the third as a
user input.

2. Area of a triangle is given by the formula A = √S(S-a) (S-b) (S-c) where a, b, and
c are the sides of the triangle and 2S = a + b + c. Write a C program to compute
the area of the triangle by taking the values of a, b, and c as user input from the
console.

3. Write a C program to compute the area and circumference of a circle for a given
radius, r. Here radius, r has to be taken as a SYMBOLIC CONSTANT.

4. Write a C program for temperature conversion. Use the following formula for
conversion.

(a) Convert the equivalent temperature in Fahrenheit (f) to Celsius (c), where f
has to be read as a user input.
(b) Convert the equivalent temperature in Celsius (c) to Fahrenheit (f), where c
has to be read as a user input.

5. Write C programs to evaluate the following expressions:


(a) 4x2 + 2x + 10
(b) 5x3 + 4x2y2 + 4y3 + 30
(Here x and y may be an integer / float quantity and have to be given by the user)

You might also like