[go: up one dir, main page]

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

Aakash Upadhyay Data Structure Assignment - 1

The document contains a series of programming assignments for a SY BSC IT course, focusing on basic C programming tasks. It includes code snippets for summing values in an array, finding the maximum and minimum numbers from user input, and manipulating a character array. Each section outlines the task, provides code examples, and indicates that outputs will follow, although specific outputs are not included.

Uploaded by

aakashpr1008
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)
31 views2 pages

Aakash Upadhyay Data Structure Assignment - 1

The document contains a series of programming assignments for a SY BSC IT course, focusing on basic C programming tasks. It includes code snippets for summing values in an array, finding the maximum and minimum numbers from user input, and manipulating a character array. Each section outlines the task, provides code examples, and indicates that outputs will follow, although specific outputs are not included.

Uploaded by

aakashpr1008
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
You are on page 1/ 2

Sem-3 Assignment-1 SY BSC IT

1. WAP to perform sum of value in array.


#include<stdio.h>
int main()
{
int i, numbers[10]=
{4,8,2,-11,4,5,3,33,-28,65};
for (i=0, numbers[10]=0;i<10;i++)
numbers[10] = numbers[i] + numbers[10];
printf("sum of values of array,numbers[10]=%d\n",numbers[10]);

}
 OUTPUT :

2. WAP to perform to fine maximum number.


#include<stdio.h>
int main()
{
int i,num[10],max;
printf("enter any 10 integer values:\n");
for(i=0;i<10;i++)
scanf("%d",&num[i]);
for(i=0;i<10;i++)
{
if (num[i] > num[i+1])
num[i+1] = num[i];
}
printf("The maximum number of the given 10 numbers is %d.\n",num[9]);
return 0;
}
 OUTPUT :

3. WAP to perform to find minimum number.


#include<stdio.h>

data structure Aakash Upadhyay


Sem-3 Assignment-1 SY BSC IT

int main()
{
int i,num[10],max;
printf("enter any 10 integer values:\n");
for(i=0;i<10;i++)
scanf("%d",num[i]);
for (i=0;i<10;i++)
{
if (num[i] < num[i])
num[i+1] = num[i];
}
printf("The minimum number of the given 10 numbers is %d.\n",num[9]);
return 0;
}
 OUTPUT :

4. WAP to perform character type array.


#include<stdio.h>
int main()
{
int i;
char alphabet[5];
printf("enter any 5 character(lower case):\n");
for(i=0;i<5;i++)
{
scanf("%c",&alphabet[i]);
}
for(i=0;i<5;i++)
alphabet[i]= alphabet[i] + 1;
printf("next corresponding character -\n");
for(i=0;i<5;i++)
printf("%c\n",alphabet[i]);
return 0;
}
 OUTPUT :

data structure Aakash Upadhyay

You might also like