Computer Programming C/C++ Previous-Paper 2013
Khyber Pakhtunkhwa Board of Technical Education Peshawar
Post Inter Diploma in Information Technology (New Course)
(1st Semester)
1st Term Examination 2013
Paper: Computer Programming C/C++
Time allowed: 3 hours
Max marks:50
Note: Attempt any five questions by selecting at least one question from each part. All questions carry equal marks. Mobile Phone & Programmable Calculators are not allowed.
Q.1:- Differentiate the following terms with suitable examples.
Variable Declaration and Variable Definition.
Identifier, Constant and Variable
Operands, Operators and Expression
Q.2:- What will be the output of the following program segment. Explain the output.
main ()
{
int a=2, b=3, x, y;
float w, z;
x= a/b * b;
y = b/a * a;
w = a/b *b;
z = b/a * a;
printf( “%d%d %f %f *, a.b,w,z);
}
Q.3:- a) What is decision control structure ? Explain the if statement and if-else statement with the help of an example.
b) Explain Break statement with example.
Q.4:-Write a program which find and Print the largest of three numbers by using nested IF statement.
Q5:- a)What is loop? Explain For Loop with the help of an example.
b) What will be the output of the following program segment.
main ( )
{
int i;
For (i=l;i <=5; printf (“ln%d”, i))
i++;
}
Q.6:- a) What is Preprocessor Directive? Why we use # include Preprocessor Directive in the start of program?
b) What is Header file? Give some examples of Header files are used in C/C++ Language.
Q.7:-Explain the following operators with the help of an example.
a) Compound Assignment Operators.
b) Increment & Decrement Operators.
c) Conditional Operator.
Q.8:-Differentiate the following built-in functions.
a) Printf () and Scanf ()
b) geleh () and Putch ()
c) Puts () and gels ()
d) Strlen () and Strlwr ()
e) Pow () and Sqrt ()
Related Posts
Basics of Computer By Muhammad Umar
Recent Posts
Ask a Question
Do you have any questions? Rest assured, we're here to provide answers. Join us in our forum where you can engage in fruitful discussions, ask your queries, and receive insightful responses from our esteemed authors and community members. We look forward to your active participation and valuable contributions as we collectively explore various topics. Let's come together and share your thoughts!