0% found this document useful (0 votes)
29 views24 pages

b36 PDF

The document contains 8 programs written in C programming language to solve different computational problems. The programs include calculating the sum of two integers, perimeter and area of a triangle, area and volume of a box, average from an input file, temperature conversion from Celsius to Fahrenheit using files, determining average with interactive input and goto statements, and calculating sectional area with interactive and formatted input/output. The problems demonstrate basic programming concepts like input/output, functions, files, and different approaches to accepting user input.

Uploaded by

Sazidul Islam
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)
29 views24 pages

b36 PDF

The document contains 8 programs written in C programming language to solve different computational problems. The programs include calculating the sum of two integers, perimeter and area of a triangle, area and volume of a box, average from an input file, temperature conversion from Celsius to Fahrenheit using files, determining average with interactive input and goto statements, and calculating sectional area with interactive and formatted input/output. The problems demonstrate basic programming concepts like input/output, functions, files, and different approaches to accepting user input.

Uploaded by

Sazidul Islam
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
You are on page 1/ 24

BANGLADESH UNIVERSITY OF ENGINEERING &

TECHNOLOGY
(BUET)

COURSE NUMBER: NAME 336


COURSE TITLE: COMPUTER PROGRAMMING IN SHIP DESIGN-1

ASSIGNMENT NO: 01

NAME : S. M. AMDADUL ISLAM


STUDENT ID: 1612033
DEPARTMENT: NAME
SECTION: A2
Table of Contents
1 Program for determine sum of two integer. ................................................................................................... 1
1.1 Code: ....................................................................................................................................................... 1
1.2 Input & output: ....................................................................................................................................... 2
2 Program for determine perimeter and area of a triangle. .............................................................................. 3
2.1 Code: ....................................................................................................................................................... 3
2.2 Input & output: ....................................................................................................................................... 4
3 Program for calculating area & volume of a box using implicit statement. .................................................... 5
3.1 Code: ....................................................................................................................................................... 5
3.2 Input & output: ....................................................................................................................................... 6
4 Program for calculating area & volume of a box using explicit statement. ..................................................... 7
4.1 Code: ....................................................................................................................................................... 7
4.2 Input & output: ....................................................................................................................................... 8
5 Program for finding average by taking value from an input file. ..................................................................... 9
5.1 Code: ....................................................................................................................................................... 9
5.2 Input file: ............................................................................................................................................... 10
5.3 Output file: ............................................................................................................................................ 11
6 Program for temperature conversion (Celsius to Fahrenheit) by taking ....................................................... 12
input from an input file. ........................................................................................................................................ 12
6.1 Code: ..................................................................................................................................................... 12
6.2 Input file: ............................................................................................................................................... 13
6.3 Output file: ............................................................................................................................................ 14
7 Program for determine average number (interactive input with goto statement) ....................................... 15
7.1 Code: ..................................................................................................................................................... 15
7.2 Input & output: ..................................................................................................................................... 16
8 Program for calculating sectional area ( interactive input & formatted input) ............................................ 17
8.1 Interactive input program code: ........................................................................................................... 17
8.2 Input & output of interactive program: ................................................................................................ 18
8.3 Formatted input program code:............................................................................................................ 19
8.4 Input file of formatted input program: ................................................................................................. 20
8.5 output file of formatted input program: ............................................................................................... 21
8.6 comparison of result obtained from both program: ............................................................................. 22
1 Program for determine sum of two integer.

1.1 Code:

1|P age
1.2 Input & output:

2|P age
2 Program for determine perimeter and area of a triangle.

2.1 Code:

3|P age
2.2 Input & output:

4|P age
3 Program for calculating area & volume of a box using implicit statement.

3.1 Code:

5|P age
3.2 Input & output:

6|P age
4 Program for calculating area & volume of a box using explicit statement.

4.1 Code:

7|P age
4.2 Input & output:

8|P age
5 Program for finding average by taking value from an input file.

5.1 Code:

9|P age
5.2 Input file:

10 | P a g e
5.3 Output file:

11 | P a g e
6 Program for temperature conversion (Celsius to Fahrenheit) by taking

input from an input file.

6.1 Code:

12 | P a g e
6.2 Input file:

13 | P a g e
6.3 Output file:

14 | P a g e
7 Program for determine average number (interactive input with goto
statement)

7.1 Code:

15 | P a g e
7.2 Input & output:

16 | P a g e
8 Program for calculating sectional area ( interactive input & formatted
input)
8.1 Interactive input program code:

17 | P a g e
8.2 Input & output of interactive program:

18 | P a g e
8.3 Formatted input program code:

19 | P a g e
8.4 Input file of formatted input program:

20 | P a g e
8.5 output file of formatted input program:

21 | P a g e
8.6 comparison of result obtained from both program:
sectional area obtained from both programs are same.

22 | P a g e

You might also like