Computer Programming C / C + + Previous Paper 2022

Categories : DIT , DIT Previous Papers 2022

Khyber Pakhtunkhwa Board of Technical & Commerce Education Peshawar

Diploma in Information Technology
(Part -I)
1st Term Examination 2022
Paper: Computer Programming C / C + +

Time allowed: 3 hours

Max marks: 50

Attempt any five questions. All questions carry equal marks.

Q.1: Write the advantage of C language.

Q.2: What are reserved words? Explain its usage with the help of program example.

Q.3: Write a C program using while loop that takes an integer for a variable X, and Return the sum of all the numbers from I to X. Hints: X=3, should return 6 which is 1+2+3

Q.4: Explain the purpose and syntax of the following Functions.
a) Putch () b) getch (). c) getche (). d) gets ().

Q.5: Write a C program that input Five-digit number, into its individual digits and print the digits separated from one another by three spaces each. Hints: for example, if user types in 42321, the program should print 4 2 32 1.

Q.6: Write a C program to find out maximum value from three integer values, using conditional operator.

Q.7: Explain the syntax of if else statement with suitable program example.

Q.8: Write short note on the following.

a) Size of () operator.

b) Priority of operators.

Related Posts

Like, Share, and Follow Us!

Leave a Reply

Your email address will not be published. Required fields are marked *

Copyright © 2022 Basics of Computer