100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
B.Tech First year (PPS) PYQ 2022 Solution $8.49   Add to cart

Exam (elaborations)

B.Tech First year (PPS) PYQ 2022 Solution

 4 views  0 purchase
  • Course
  • Institution

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

[Show more]

Preview 4 out of 32  pages

  • May 9, 2024
  • 32
  • 2022/2023
  • Exam (elaborations)
  • Questions & answers
avatar-seller
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;
}

, (1) 65 (ii.) 90 (iii) 97 (iv) 122
ANS – ( ii) 90


(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


Syntax : -
while (condition)
{
Statements;
}
Flow charts -
Start




Cond.




Statement Stop

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

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

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

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.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

77254 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$8.49
  • (0)
  Add to cart