Department of Computer Science & Engineering Faculty of Science & Information Technology
Lab Final Section: PC-F Semester: Summer 2020
Course Code: CSE 123 Course Title: Programming & Problem Solving Lab 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.
2. Write a C program to input marks of five subjects Physics, Chemistry, Biology, Mathematics and Computer, calculate percentage and grade according to given conditions:
If percentage >= 90% : Grade A If percentage >= 80% : Grade B If percentage >= 70% : Grade C If percentage >= 60% : Grade D If percentage >= 40% : Grade E If percentage < 40% : Grade F Example
Input
Input marks of five subjects: 95 95
97 98 90
Output
Percentage = 95.00 Grade A
3. Write a C program to input a number from user and count number of digits in the given integer.
Example Input
Input num: 35419
Output
Number of digits: 5