Programming Fundamentals BSCS 1 Semester/Term UOG — University of Gujrat 2024
Discussion
Ask a question about this paper, or help someone else with theirs. Answers are emailed to whoever asked.
No questions yet — be the first to ask.
Need Paper?
See all →
Need a paper or stuck on a question? Ask here — students reply and you get an email.
Ask about a paper-
ICT 1st sister paper
0 replies Reply → -
BS Islamic Studies, 5th semester, ISL-511 Translation of Holy Quran (3) — Government College University Faisalabad (GCU…
0 replies Reply → -
Civics course code GCCE101
1 reply Reply → -
BS 4the semester2025 civics and community engagement past paper According UOs
0 replies Reply → -
Bs public administration 1st semester mid term past papers
0 replies Reply →
Ad
Paper text
University of Gujrat
Programming Fundamentals
Teacher: Ehtisham Rasheed
Semester: Fall-2024
Total Marks: 25
Course Code: CS-102
Time: 1:30 hrs
Mid Term
BSCS (15 Semester)
Q1. Write only a code to find maximum number among three numbers using switch statement.
Q2. Suppose a, b and c are int variables and a = 5, b = 6 and c = 4. What value is assigned to each variable after
each statement executes?
[4]
[3]
a
a=(b++)+ 3;
c=2*a+(++b);
b=2*(++C)-(at+):
Q3. Write a C++ program that prompts the user to input the elapsed time for an event in hours, minutes and
seconds. The program must get input in this format hh: mm: ss. The program then outputs the elapsed time in
seconds.
Q4. Suppose that x, y and z are int variables, and x = 10, y = 15, and z = 20. Determine whether the following
expressions evaluate to true or false.
(5]
[2]
(× I=5) && (y!=2)
ih
(x<=y-2)11(2-21=20)&&(y>=z)
Q5. Write a program that inputs a number from user and then find the reverse of it.
Q6. Write a C++ program to make such a pattern like a pyramid with an asterisk. Sample output of the program
is shown below:
[5]
[6]
Input number of rows: 5.
K
*