B.Tech first-year programming for problem-solving (PPS) covers fundamental concepts. Topics include variables, data types, and control structures like loops and conditionals. Functions enable modular programming, while arrays and strings handle data efficiently. Recursion offers elegant solutions. ...
Bihar Engg. University , Patna
B. Tech Previous year Question Solved Paper (2022)
Subject - Programming For Problem Solving (PPS)
Code : 100104 Full Marks : 70
Q 1. Choose the correct answer of the following .
( a ) What does the following declaration mean ?
Int *ptr [5] ;
(i) ptr is an array of pointer to 5 integers
(ii) ptr is an array of 5 integers
(iii) ptr is a pointer to an array of 5 integers
(iv) ptr is a pointer to array
ANS – (iii) ptr is a pointer to an array of 5 integer
(b) The function malloc ( ) is declared in which header file .
(i) stdio.h (ii) stdlib.h (iii) conio.h (iv) iostream.h
ANS – ( ii) < stdlib.h >
( c) #include<stdio.h>
int main( )
{
char ch = ‘ Z ‘
printf ("%d\n", ch ) ;
return 0;
}
(d) How is an array initialized in C language?
(1) int a[3] = (1,2,3);
(ii) int a= (1,2,3);
(iii) int a[ ] = new int[3]:
(iv) int a(3)=[1,2,3];
ANS – (1) int a[3] = (1,2,3);
(e) What is the return type of the fopen( ) function in C ?
(i) Pointer to a FILE object.
(ii) Pointer to an integer.
(iii) An integer.
(iv) None of the above
ANS - (i) Pointer to a FILE object.
(F) What will be the output of the following C Code?
#include<stdio.h>
int main()
{
int x=4, y, z
y= --x:
Z=X- - ;
printf("%d%d%d", x, y, z);
}
(1) 3 2 3 (ii) 2 2 3 (iii) 3 2 2 (iv) 2 3 3
,ANS – (iv) 2 3 3
(g) The keyword used to transfer control from a function back to the
Calling function is .
(1) switch (ii) return (iii) continue (iv) go to
ANS – (ii) return
(h) #include<stdio.h>
int main()
{
Float a = 5 , b=2 ;
int c ,d:
c = a/b ;
d = c/2 ;
printf("%d", d );
return 0 ;
}
(i)1 (ii.) 0 (iii) 1.5 (iv) 1.25
ANS – (i)1
(i) In C, if you pass an array as an argument to a function, what
actually gets passwd ?
(1) First element of the array
(ii) Value of elements of the array
(iii) Base address of the array
(iv) Address of the last element of array
ANS – (iii) Base address of the array
( J ) How is the 3rd element in an array accessed based on pointer
notation
, (i) *a+3 (ii) *(a+3) (iii) *(*a+3) ( iv) &(a+3)
ANS – (ii) *(a+3)
Q 2. (a) Explain entry controlled loop and exit controlled loop with
flow - charts and examples.
ANS - Entry controlled loop (while loop) :- while loop execute the code
until condition is false .
while loop is called entry controlled loop
Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.
Quick and easy check-out
You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.
Focus on what matters
Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!
Frequently asked questions
What do I get when I buy this document?
You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.
Satisfaction guarantee: how does it work?
Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.
Who am I buying these notes from?
Stuvia is a marketplace, so you are not buying this document from us, but from seller poojamaurya. Stuvia facilitates payment to the seller.
Will I be stuck with a subscription?
No, you only buy these notes for $8.49. You're not tied to anything after your purchase.