0% found this document useful (0 votes)
7 views2 pages

C Programming Homework Week 2 Tasks

The homework assignment for Week 2 in the Structured Programming in C course focuses on data types and program structure. Students are required to write C programs for various problems, including calculating the area of a rectangle, temperature conversion, simple interest, and average marks, using both compile-time and run-time initialization. Submission includes a Word file with detailed solutions, algorithms, program code, and output screenshots, due by Sunday, 17th August.

Uploaded by

UMANG PATEL
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)
7 views2 pages

C Programming Homework Week 2 Tasks

The homework assignment for Week 2 in the Structured Programming in C course focuses on data types and program structure. Students are required to write C programs for various problems, including calculating the area of a rectangle, temperature conversion, simple interest, and average marks, using both compile-time and run-time initialization. Submission includes a Word file with detailed solutions, algorithms, program code, and output screenshots, due by Sunday, 17th August.

Uploaded by

UMANG PATEL
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

Homework Assignment - Week 2

Course: Structured Programming in C


Topic: Data Types, Structure of C Program, Input/Output

Instructions:
• Write programs in C with proper comments.

• Follow the standard structure of a C program (header files, main function, declaration,
logic, output).

• Submit `.c` files with meaningful filenames.

• For each problem, write one solution using compile-time initialization and another using
run-time initialization (if applicable).

Assignment Problems
1. Area of a Rectangle
- Given length and breadth (both compile-time and run-time).

2. Temperature Conversion
- Convert temperature from Celsius to Fahrenheit.
- Formula: F = (C × 9/5) + 32

3. Simple Interest Calculation


- Formula: SI = (P × R × T) / 100
- Take P, R, and T both by compile-time and run-time.

4. Average of Three Marks


- Calculate average marks of 3 subjects, display as float value with 2 decimal places.

Extra Challenge (Optional)


• Write a program to calculate the total and average of marks for 5 students, where marks
are entered at run-time. Use meaningful variable names.

• Write a program to swap the values of two variables without using a third variable, using
run-time input.

Submission Guidelines:

• Create a Word file and include your full name at the top.

• For each question:


1. Write the question statement.

2. Write an Algorithm/ Flowchart

3. Add your program code.

4. Insert a screenshot of the program’s output.

• Save the file as a PDF.

• Upload the PDF using the shared Google Form.

• Deadline: Sunday 17th August.

You might also like