Computer Programming C/C++ Previous-Paper 2013


0
Categories : DIT , DIT Previous Papers 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.

  1. Variable Declaration and Variable Definition.

  2. Identifier, Constant and Variable

  3. 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

Like, Share, and Follow Us!

Leave a Reply

Your email address will not be published.

Copyright © 2022 Basics of Computer