0% found this document useful (0 votes)
20 views3 pages

Pyq C (2018)

The document outlines an examination format for a C programming course, including instructions for answering questions and a variety of question types such as multiple choice, code output, and programming tasks. Students are required to answer a compulsory question and select additional questions from a provided list. The exam covers fundamental concepts in C programming, including data types, operators, memory management, and functions.

Uploaded by

ranajitbarik2005
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views3 pages

Pyq C (2018)

The document outlines an examination format for a C programming course, including instructions for answering questions and a variety of question types such as multiple choice, code output, and programming tasks. Students are required to answer a compulsory question and select additional questions from a provided list. The exam covers fundamental concepts in C programming, including data types, operators, memory management, and functions.

Uploaded by

ranajitbarik2005
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

332(S)

December 2018

C PROGRAMMING

Time Allowed: 3 Hours Full Marks: 70

Answer to Question No.1 is compulsory and to be answered first.


: This answer is to be made in separate loose script(s) provided for the purpose.
Maximum time allowed is 45 minutes, after which the loose answer scripts will be collected and
fresh answer scripts for answering the remaining part of the question will be provided.
On early submission of answer scripts of Question No.1,
a student will get the remaining script earlier.

Answer any five questions from the rest.

A. Choose the correct answer from the given alternatives (any ten): 1x10=10

i) C language has been developed by (a) Ken Thompson (b) Dennis Ritchie (c) Peter Norton
(d) Martin Richards.
The expression x=4+2%-8 evaluates to (a) -6 (b) 6 (c) 4 (d) 2.

Pick the odd one out : (a) a=a+1 (b) at=1 (c) at++ (d) a=+1.

Which operator produces the 1’s complement of the given binary value? (a) logical AND
(b) bitwise AND (c) logical OR (d) bitwise NOT.

A statement block consists of how many statements? (a) 0 (b) 1 (c) n (d) none of the
above.

If an array is declared as int arr[5][5], how many elements can it hold? (a) 5 (b) 10 (c) 25
(d) 50.

vii) Which variable retains its value in-between function calls? (a) Auto (b) Static (c) Register
(d) Extern.

Array name is a (a) keyword (b) structure (c) union (d) pointer.

The function malloc() is declared in which header file? (a) stdio.h (b) stdlib-h (c) conio.h
(d) iostream.h

Memory for the structure is allocated at the time of (a) structure definition (b) structure
variable declaration (c) structure declaration (d) function declaration.

xi) The preprocessor directives must be preceded by which symbol? (a) * (b) & (c) ! (d) #

B. What will be the output of the following codes? (any five): $x2=10

i) fiain()
int i=1;
for(;;)
{
printf("\n%d" i++);
if(i<=10)

Se
break;

}
}

ii)
int prodtint x. int y)
return(x*y)s
}
main()

intx=2y=3.25
z=prod(x,prod(x,y))s

print{("%d",2);
}

iii) main()
{ :
int arr{}={1,2,3,4,5}5
int *ptr,i;
ptr=arr+4; He
for(i=4;i>=051-- ;
printf("%d " *(ptr-i));
}
iv) #define cube(x) (x*x*x)
main()
Ch int J;
j=cube(2+1);
printf("%d".j)
}
main()

int i=30;
switch(i)

default:
printf("\nNo matching value");
break;
case 1:
printf("\nThe value is 1");
break;
case 2:
printf("\nThe value is 2");
break;
case 3:
printf("\nThe value is 3");
}
BAe

}
main()
{
int x=10,y=20;
if(x==y);
printf("%d %d" x,y);
printf("\nGood by");
What is the difference between i++ and ++i? Explain with proper example.
to

Explain break and continue statement with an example. 5+5

Wnite a program to get the sum of digits of a number entered through keyboard.
Write a program to print the following using nested loop: ae]

10
110
1110

a) Differentiate between a character and a string.


using string.h. 3+7
b) Write a program to enter a string and check if it is palindrome or not without

a) Differentiate between call by value and call by reference. 5+5


b) Explain the concept of recursive function with an example.

a) Explain the difference between a null pointer and a void pointer.


b) Differentiate between malloc() and calloc(). 2a
ts using a pointer.
c) Write a program to illustrate of accessing an array’s elemen
array of structure.
a) Differentiate between array within a structure and 4+6
with the help of an example.
b) Is it possible to create an array of structure? Explain

a) What is the significance of EOF?


and ftell() functions?
b) What are the common uses of rewind() 2+4+4
fi le can be opened? Describe each of them.
c) What are different modes by which a

You might also like