Time: 2.0 hours
1. I am very happy to inform you that this is your task for today. And the task is to send both Rosy and Nosy to their home planet so that they cannot disturb us anymore. To send them both to their home planet you have to tell them “Rosy & Nosy! Go back to your Home.” But this message has to be printed in new lines for N+10 times. What is this N? How do you determinate it? We’ll take the last three digit of your ID as input from user as M. Then perform N = (M % 9) and print the message N+10 times.
Remember to print the new line after every message.
Sample Input Sample Output
100 Rosy & Nosy! Go back to your Home.
Rosy & Nosy! Go back to your Home.
Rosy & Nosy! Go back to your Home.
Rosy & Nosy! Go back to your Home.
Rosy & Nosy! Go back to your Home.
Rosy & Nosy! Go back to your Home.
Rosy & Nosy! Go back to your Home.
Rosy & Nosy! Go back to your Home.
Rosy & Nosy! Go back to your Home.
Rosy & Nosy! Go back to your Home.
Rosy & Nosy! Go back to your Home.
1. Write a C program to input marks of five subjects of a student and calculate total, average and percentage of all subjects. How to calculate total, average and percentage in C programming. Logic to find total, average and percentage in C program.
Department of Computer Science & Engineering Faculty of Science & Information Technology
Lab Final Section: PC-G Semester: Summer 2020
Course Code: CSE 123 Course Title: Programming & Problem Solving Lab
Example
Input
Enter marks of five subjects: 95 76 85 90 89
Output Total = 435 Average = 87 Percentage = 87.00
2. Write a C program to input basic salary of an employee and calculate gross salary according to given conditions.
Basic Salary <= 10000: HRA = 20%, DA = 80%
Basic Salary is between 10001 to 20000 : HRA = 25%, DA = 90%
Basic Salary >= 20001 : HRA = 30%, DA = 95%
Example
Input
Input basic salary of an employee: 22000 Output
Gross salary = 44000