Question: Question#1 [Marks: 10 (2,2,4,2)]: Write a C++ program to create user_defined datatype as Fruits having attributes as Name, color and price. In main() create user
Question#1 [Marks: 10 (2,2,4,2)]:
Write a C++ program to create user_defined datatype as Fruits having attributes as Name, color and price. In main() create user define size array of fruits and perform following operations on this array:
Create (input)
Read (display)
Count number of fruits having green color and display the count in main().
Question#2 [Marks 10: 5+5]
a) Write a C++ program which will create 5 variables to solve following expression and display the answer.
Result=a2 +b3 c+d
b) Write a C++ program which will create a string in main(), take input in string from user and count the number of words in the string.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
