Professional Documents
Culture Documents
• Easy to maintain
If we are searching the data from the data structure and we are given
to computer to fetch the wrong data then it will give us the wrong
data. If we will give the wrong input then the output will also be the
wrong. Data structure is the organized data from which we can get
information.if we search any data we search the wrong data then it
will give the wrong output.
Qno.2>describe the concept of abstract data type in data
structure?
Ans .. it is the way to looking up at the data structure. From the
abstract data type we can focus and ignore the jobs. The example of
the ADT is the stack. For more decription of the ADT we will learn the
data type and abstract.
• Data type: the data type is represent the type of the data. We can
know that what kind of the data is: is it integer type or float type.
Ans:- . the given array is the linear array. A linear array is a list of a
finite number n of homogeneous data elements the linear array first
nameee is b.
• set b[i+1]=b[i]
• quit
Qno.6> each std of a class of 30 stds take 6 test in which score
ranges 0 to 100, suppose the test score are stored in 30*6 array
test find the average grade for each test.
Ans.
#include<stdio.h>
#include<conio.h>
Void main()
{
int b[6],i,n;
float percentcentsent=0;
char firstnameee[30];
clrscr();
printf("enter how many stds");
scanf("%d",&n);
for(i=0;i<n;i++)
{
else
if(percentcentsent>=90&&percentcentsent<95)
{
printf("Grade:=A");
}
else if(percentcentsent>=80&&percentcentsent<90)
{
printf("Grade:=B");
}
else if(percentcentsent>=70&&percentcentsent<80)
{
printf("Grade:=c");
}
else if(percentcentsent>=60&&percentcentsent<70)
{
printf("Grade:=D");
}
else
{
printf("Grade:=E");
}
}
getch();
}
Qno.7 find the final grade for each std where the final grade is
average of the stds five highest test scores?
Ans .. #include<stdio.h>
#include<conio.h>
void main()
{
int subjectject[6],i,n,j,temp;
float percentcent=0;
char first namee[30];
clrscr();
printf(" the no. of stds are");
scanf("%d",&n);
for(i=0;i<n;i++)
{
for(i=0;i<5;i++)
{
percentcent=(percentcent+subjectject[i]/5);
}
for(i=0;i<5;i++)
{
percent=(percent+subject[i]/5);
}
printf("Percent %f :",percent);
if(percent>=95)
{
printf("Grade:=A+");
}
else if(percent>=90&&percent<95)
{
printf("Grade:=A");
}
else if(percent>=80&&percent<90)
{
printf("Grade:=B");
}
else if(percent>=70&&percent<80)
{
printf("Grade:=c");
}
else if(percent>=60&&percent<70)
{
printf("Grade:=D");
}
else
{
printf("Grade:=E");
fails++;
}
}
printf("\n the fails are %d",fails);
getch();
}
Ques 9:-: Find the average of final grades
Ans;-
#include<stdio.h>
#include<conio.h>
void main()
{
int subject[6],i,n,j,temp,fails=0;
float percent=0;
char first name[30];
clrscr();
printf("enter the no. of stds");
scanf("%d",&n);
for(i=0;i<n;i++)
{
for(i=0;i<5;i++)
{
percent=(percent+subject[i]/5);
}
printf("Percentcentage is %f :",percent);
if(percent>=95)
{
printf("Grade:=A+");
A1++
}
else if(percent>=90&&percent<95)
{
printf("Grade:=A");
A++
}
else if(percent>=80&&percent<90)
{
printf("Grade:=B");
B++
}
else if(percent>=70&&percent<80)
{
printf("Grade:=c");
C++
}
else if(percent>=60&&percent<70)
{
printf("Grade:=D");
D++
}
else
{
printf("Grade:=E");
fails++;
}
}
printf("\the failsures are %d",fails);
getch();
}