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

Don Bosco Institute of Technology Department of Basic Science and Humanities 2021-2022 C Programming Lab

The document outlines a C programming lab experiment conducted by Shubham Keluskar at Don Bosco Institute of Technology, focusing on calculating the sum of 10 integer numbers using arrays. It includes the learning outcomes, problem definition, algorithm, flowchart, code implementation, and the output demonstrating the functionality. The conclusion emphasizes the understanding of array indexing and representation through this exercise.

Uploaded by

Shubham Keluskar
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)
2 views3 pages

Don Bosco Institute of Technology Department of Basic Science and Humanities 2021-2022 C Programming Lab

The document outlines a C programming lab experiment conducted by Shubham Keluskar at Don Bosco Institute of Technology, focusing on calculating the sum of 10 integer numbers using arrays. It includes the learning outcomes, problem definition, algorithm, flowchart, code implementation, and the output demonstrating the functionality. The conclusion emphasizes the understanding of array indexing and representation through this exercise.

Uploaded by

Shubham Keluskar
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/ 3

Don Bosco Institute of Technology

Department of Basic Science and Humanities


2021-2022
C programming Lab
Division/ Roll B/26/B Name of Student Shubham Keluskar
number/ Batch
Date of 12/05/2022 Date of Submission 16/05/2022
Performance
Experiment No. 4 A
Title To calculate and display the total 10 integer numbers
Learning Concept of array
Outcomes Single dimensional array
Multi dimensional array
Theory An array is defined as the collection of single type of data items stored at contiguous
memory location
Problem To create an array that takes 10 numbers as input and prints out the total of those
Definition number
Algorithm 1. Start
2. s=0
3. print enter 10 numbers
4. i=0
5. evaluate i<10
6. if true,
scanf(“%d”,&a[i])
s=s+a[i]
i=i+1
7. Repeat steps 5 and 6 till evaluated as false
8. If false
Printf(“\n numbers stored in array:”);
9. i=0
10. Evaluate i<0
11. If true,
Printf(“a[%d]=%d\n”,I,a[i]);
i=i+1
12. Repeat step 10 and 11 till evaluated as false
13. If false
Printf(“\n sum of integer numbers %d”,s)
14. stop
Flowchart

start

int i=0, sum=0,


a[10 ]

false
i<10

true

i++ Print sum


Scan a[i]

sum=sum+a[i] stop

Code #include <stdio.h>


#include <stdlib.h>

int main()
{
int i=0 ,sum =0 ,a[10];
printf("enter 10 numbers\n");
for(i=0;i<10;i++){
scanf("%d",&a[i]);
sum = sum + a[i];
}
printf("\n Number stored in array\n");
for(i=0;i<10;i++){
printf("a[%d] = %d\n",i,a[i]);

printf("\n the sum is %d",sum);

return 0;
}
Output enter 10 numbers
1
2
3
4
5
6
7
8
9
0

Number stored in array


a[0] = 1
a[1] = 2
a[2] = 3
a[3] = 4
a[4] = 5
a[5] = 6
a[6] = 7
a[7] = 8
a[8] = 9
a[9] = 0

the sum is 45
Conclusion An array along with for loop is used in order to calculate sum of 10 numbers
In the above experiment we learned about array indexing and representation

You might also like