Sturcture
Sturcture
(Total # questions)
1 Declare a structure of students with three member variables (name, id and cgpa), where name is a *
string and id are strings, and cgpa is a float value.
2 Declare a structure of students with three member variables (name, id and cgpa), where name is a *
string and id are strings, and cgpa is a float value with default values.
3 Given a structure student, which has three member variables (name, id and cgpa), declare a variable *
of structure student.
4 Given a structure student, which has three member variables (name, id and cgpa), declare a variable *
of structure student. Display the value of the member variables.
5 Given a structure student, which has three member variables (name, id and cgpa), declare a variable *
of structure student. Assign values to the member variables.
6 Given a structure student, which has three member variables (name, id and cgpa), declare a variable *
of structure student. Populate the member variables from the keyboard.
7 Declare a structure of students with three variables (name, id and cgpa). Take information of two *
students as input and show the output.
101 101
3.5 3.5
102 102
2.7 2.7
8 Declare a structure of students with three variables (name, id and cgpa). Now take the *
input of two students and print the information of that student who has the higher cgpa.
101 101
3.5 3.5
Tamim Iqbal
102
2.7
9 Declare a structure of students with three variables (name, id and cgpa). Now take the **
input of two students and print the information of that student who has better cgpa with
a function.
101 101
3.5 3.5
Tamim Iqbal
102
2.7
10 You have to declare a structure named triangle. triangle_id, base and height are the *
members of this structure. Now you will have to take input of three triangles and find out
the area of each triangle.
5 Area of 2 = 12
8 Area of 3 = 6
4
11 You have to declare a structure named triangle. triangle_id, base and height are the **
members of this structure. Now you will have to take input of three triangles and find out
which triangle has the maximum area using a function.
1 Area of 1 = 20
4
12 The Tigers have clinched a stunning victory over their rivals recently. In that series of three **
matches, some players put up some amazing performances. Now you have to create a
structure named player where you have to store the following information of each player:
1. Player’s name
2. Player’s country
Now, take input of two players and calculate the points for each player for all the three
matches.
75 Match 2:
1 Match 3:
Tamim Iqbal
Bangladesh
100
109
17
0
13 The Tigers have clinched a stunning victory over their rivals recently. In that series of three ***
matches, some players put up some amazing performances. Now you have to create a
structure named player where you have to store the following information of each player:
1. Player’s name
2. Player’s country
Now, take input of two players and calculate the points for each player for all the three
matches. And also find man of the match(MOM) for each match based on their points and
find out the man of the series on more points overall.
75 Match 2:
5 Match 3:
Bangladesh
Man of the Series: Shakib Al Hasan
100
109
17
0
Today 8th class: Online 3 ; Structure
9th class: Mid viva(Loop,Array,String); recursion
10th class: Online 4 & online 5(Function and recursion);
11th class: Recursion and Pointers
12th class: Online 6 and Final Viva