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
User Story Confusion: Creating and Breaking Them Down
Unlock the secrets of user story confusion with the Carnsa Development series! Join Bob, the bright son of the Carnsa family, as he enlists the help of his granny to break down user stories into manageable chunks. Discover proven techniques and strategies to help you and your team create and implement user stories with ease.
Order your copy of 'User Story Confusion: Creating and Breaking Them Down' now!
