Problem 81: Struct GPA

Create a simple structure named Student that holds the following variables-
i. id (integer)
ii. cgpa (float)
iii. name (string)
Now create an instance of that structure named s1 and scan the values from the user. Finally print the id, cgpa and name which user entered.

 

4,214 total views, 2 views today

Problem 82: Books

Create a simple structure named Book that holds the following data fields-
i. id (integer)
ii. title (string)
iii. author(string)
Now create two structure variables of Book type named book1 and book2. Set the following information for the books-
For book1:
id: 101
title: C Programming Hand Note
author: Mukla.C

For book2:
id: 102
title: Programming with Fun
author: Joy Billah

Finally, print all the information of the two books.

 

1,867 total views, no views today

Problem 83: Tennis Ball

Create a structure named TanisBall where we have two fields- color (string) and weight (float). Now create a pointer variable of structure TanisBall named myBall. Scan the field values for myBall from user and finally print the information of myBall using that pointer variable myBall.

 

1,429 total views, no views today

Problem 84: Writer Records

Create a structure named Writer with two fields- name (string) and genre (string). Then create an array of Writer named writerRecords. Insert the following records into the array-
i. name- Mukla.C; genre- Technical
ii. name- Mostasim Billah; genre- Technical
iii. name- Mahady Joy; genre- Technical
Finally, print the records of the array by iterating the array using loop.

 

1,883 total views, no views today

Problem 85: Product

Create a structure named Product with following two fields-

1. name (string)
2. price (double)

Then create a function named printProductInfo() which takes a parameter of Product type and print the information of that Product. Finally, in main function create a variable of structure Product named myProduct and call the printProductInfo() function passing myProduct as the parameter.

 

1,468 total views, no views today