Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Exam (elaborations)

B.Tech First year (PPS) PYQ 2022 Solution

Rating
-
Sold
-
Pages
32
Grade
A
Uploaded on
09-05-2024
Written in
2022/2023

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. Pointers and dynamic memory allocation manage memory effectively. File handling involves reading/writing files and error handling.

Show more Read less
Institution
Course

Content preview

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

Written for

Institution
Course

Document information

Uploaded on
May 9, 2024
Number of pages
32
Written in
2022/2023
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$8.99
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
poojamaurya

Get to know the seller

Seller avatar
poojamaurya Government Engineering College ,Arwal
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
1 year
Number of followers
0
Documents
1
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions