Computer Programming C / C + + Previous Paper 2020
Khyber Pakhtunkhwa Board of Technical Education Peshawar
Diploma in Information Technology
1st Term Examination 2020
Paper: Computer Programming C / C + +
Time allowed: 3 hours
Max marks: 50
Attempt any five questions. All questions carry equal marks.
Q1. What is C++? Write down the differences between C and C++.
Q2. What are experimental real constants and string constants? Explain with example.
Q3. Write the purpose and syntax of do while loop and show difference between loop and do while loop.
Q4. Write a program to find the largest number among any three given numbers.
Q5. What output of the following program?
int number = 5;
printf(“%d is an even number”,number);
printf(“%d is an odd number”,number”);
Q6. Write a comprehensive note on.
i. print f ( )
ii. scanf ( )
iii. puts ( )
Q7. Write a program that adds two numbers and elaborate the structure C by exemplifying it.
Q8. Write the purpose, syntax and example of the following C function.
i. Abs ( )
ii. rand ( )
iii. Pow ( )
iv. Strncat ( )