0% found this document useful (0 votes)
5 views

22 non core

The document outlines a programming examination for B.Tech students at Jalpaiguri Government Engineering College, covering various topics in C programming. It includes objective type questions and long answer questions that require students to write C programs, explain concepts like loops, macros, and data structures, and solve problems related to arrays and pointers. The exam is structured to assess both theoretical knowledge and practical coding skills.

Uploaded by

Shounak Mondal
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

22 non core

The document outlines a programming examination for B.Tech students at Jalpaiguri Government Engineering College, covering various topics in C programming. It includes objective type questions and long answer questions that require students to write C programs, explain concepts like loops, macros, and data structures, and solve problems related to arrays and pointers. The exam is structured to assess both theoretical knowledge and practical coding skills.

Uploaded by

Shounak Mondal
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

_ Answer all questions

A
7. i) Write aC program to sort a

JALPAIGURI GOVERNMENT ENGINEERING COLLEGE


[A GOVERNMENT AUTONOMOUS COLLEGE]

JGEC/B.TECHL/CSE/ECE/IT/ES-CS201/2021-22
2022
PROGRAMMING FOR PROBLEM SOLVING

Full Marks: 70 Times: 3 Hours

The figures in the margin indicate full marks.


Candidates are requested to write their answers in their own words as far as
practicable.

GROUP-A
[OBJECTIVE TYPE QU ESTIONS]
5x2=10

1E Convert (41819)jo =()ie

What is type casting?

us

Which one is the right output?

char name[ ]= “Computer Science”;


printf(“%d”,strlen(name));

a)19 6)20 o)21 d)none ofthese

4. #define JGEC(x) (x*20)


void main( )

f
r

int a=3, b;
b= JGEC(a + 2);
printf(“\n%d”,b);

}
What will be the output?
a)101 b)5 oc)25_ d)none ofthese

5. Which operator can be used to access Union data members if the Union data is
accessed using union to
pointer variable?

. GROUP-B
[LONG ANSWER TYPE QUESTIONS]

Answer any four questions 4x15=60


6. i) Write down the difference between Entry controlled loop and Exit controlled
loop with suitable example.
ii) Write down the advantages and disadvantages of “switch” over “if-else”?

iii) Distinguish between i++ and ++i with suitable example.


iv) Let a2 D array is declared asint a[2][3];What is the total memory size
allocated by this array and maximum how
many elements canbe stored in this array?If the base address is 2000, compute the
address of a[1][2]. [Size of

an integer variable 2 bytes].


4+3+3+5

1-D array in descending order using bubble sort technique.

ii) What is macro? What is the difference between macro and C function?

jii) Write a C program to check whether a string is palindrome or not without using
string header file.
5+(2+3)+5

FA i) i) Write aC program to print the sum of the following series:


E 2 x3
S= 1—x+2—F + up to N" term.

ii) Write down the difference between array of character and string? Explain with
suitable example the mechanism

of structure pointer. a earn fate


--) Write a C program to transpose a matrix and display the resultant matrix.
iit) F 6+(143)+5

PTO
10.

11.

1) Write a complete C program to print the Fibonacci series up to n" term?

ii) Write a C program to search an element from a given array using binary searc
be taken from user.

Explain call by value and call by reference with example.

h technique. All the inputs should

5+5+5
1) Define a structure called cricket that will describe
player name,
team name,
batting average
age F
Using cricket, declare an array player with 50 elements and write a program to read
the information
about all the 50 players and display them
ii) Calculate the total required memory of the structure cricket that you have
created.
iii) Differentiate between structure and union.
iv) What is self-referential structure? Give an example of unary operator.
74+243+3

i) Write a program to calculate and display the truth table of all the unique
Boolean functions of two variables.
li) Write a C program to print the following pattern

54545

4545

$45

45

5
iii) What are auto, external and static variables? Explain their uses with suitable
examples. pee
i) What is pointer? What do you mean by pointer arithmetic?
ii) Write a C program to interchange two integer numbers using call by reference.
iii) Write an user friendly C program to create a link list by inserting the
elements from the beginning.
What is the difference between malloc and calloc?

(24+3)+54372

END

You might also like