You are on page 1of 8

03/03/2022, 12:17 MID SEMESTER QUESTION PAPER PROGRAMMING IN C

Who is the father of C language?

Steve Jobs

James Gosling

Dennis Ritchie

Rasmus Lerdorf

Clear selection

The brain of the Computer is the

Control Unit

ALU

CPU

All of these

Clear selection

Which of the following is not a character?

'A'

"A"

''

'*'

Clear selection

https://docs.google.com/forms/d/e/1FAIpQLSdaZIW6mdo5AqqDAoU7QhFkYRi6LpHUHXOcCiE0k1HJw5HWgg/viewform?vc=0&c=0&w=1&flr=0&… 2/9
03/03/2022, 12:17 MID SEMESTER QUESTION PAPER PROGRAMMING IN C

Which of the following is not a valid C variable?

int number;

float rate;

int variable_count;

int $main;

Clear selection

Which keyword is used to prevent any changes in the variable within a C


program?

immutable

mutable

const

volatile

Clear selection

What is the size of char in a 32 bit C compiler?

1 bit

2 bits

1 Byte

2 Bytes

Clear selection

https://docs.google.com/forms/d/e/1FAIpQLSdaZIW6mdo5AqqDAoU7QhFkYRi6LpHUHXOcCiE0k1HJw5HWgg/viewform?vc=0&c=0&w=1&flr=0&… 3/9
03/03/2022, 12:17 MID SEMESTER QUESTION PAPER PROGRAMMING IN C

What will be the output of the following C code? #include <stdio.h> int main() {
int y = 10000; int y = 34; printf ("Hello World ! %d \n ",y); return o; }

compile time error

Hello World ! 34

Hello World ! 10000

Hello World ! followed by a junk value

Clear selection

What will happen if the following C code is executed? #include<stdio.h> int


main() { int main = 3; printf ("%d", main ); return 0; }

it will cause a compile time error

it will cause a run time error

it will run without any error and prints 3

it will experience infinite looping

Clear selection

Which of the following is a multi - way decision statement ?

if - else

if - else - if

switch

do while loop

Clear selection

https://docs.google.com/forms/d/e/1FAIpQLSdaZIW6mdo5AqqDAoU7QhFkYRi6LpHUHXOcCiE0k1HJw5HWgg/viewform?vc=0&c=0&w=1&flr=0&… 4/9
03/03/2022, 12:17 MID SEMESTER QUESTION PAPER PROGRAMMING IN C

Which statement is used to terminate the execution of the nearest enclosing


loop in which it appears ?

break

continue

default

case

Clear selection

Function declaration statement identifies a function with its

name

arguments

data type of return value

all of these

Clear selection

Memory is allocated for a function when the function is

declared

defined

called

returned

Clear selection

https://docs.google.com/forms/d/e/1FAIpQLSdaZIW6mdo5AqqDAoU7QhFkYRi6LpHUHXOcCiE0k1HJw5HWgg/viewform?vc=0&c=0&w=1&flr=0&… 5/9
03/03/2022, 12:17 MID SEMESTER QUESTION PAPER PROGRAMMING IN C

The default storage class of global variables is

auto

static

register

extern

Clear selection

How many times i's value is checked in the following C program?


#include<stdio.h> int main() { int i = 0; while ( i< 3) i++; printf (" In while loop \n " ); }

Clear selection

What will be the output of the following code? #include <stdio.h> int main() { int i
= 0; do { i++; if ( i == 2) continue; printf (" In while loop "); } while (i<2); printf ("%d
\n ", i); }

in while loop 2

in while loop in while loop 3

in while loop 3

infinite loop

Clear selection

https://docs.google.com/forms/d/e/1FAIpQLSdaZIW6mdo5AqqDAoU7QhFkYRi6LpHUHXOcCiE0k1HJw5HWgg/viewform?vc=0&c=0&w=1&flr=0&… 6/9
03/03/2022, 12:17 MID SEMESTER QUESTION PAPER PROGRAMMING IN C

Given an integer array, arr [], the i th element can be accessed by writing

(arr+i)

* ( i+arr)

arr[i]

all of these

Clear selection

If an array is declared as int arr [5][5], how many elements it can store?

25

10

Clear selection

What is the output of the following C program? #include<stdio.h> int main () { int
a [3] = { 10, 12, 14}; a[1] =20; int i = 0; while ( i<3) { printf ( " % d ",a[i]); i++; } }

20 12 14

10 20 14

10 12 20

compiler error

Clear selection

https://docs.google.com/forms/d/e/1FAIpQLSdaZIW6mdo5AqqDAoU7QhFkYRi6LpHUHXOcCiE0k1HJw5HWgg/viewform?vc=0&c=0&w=1&flr=0&… 7/9
03/03/2022, 12:17 MID SEMESTER QUESTION PAPER PROGRAMMING IN C

What is the output of the following C program? #include <stdio.h> int main() { int
a[] = { 1,2, 3,4 }; int b[4] = { 5, 6, 7, 8 }; printf ("%d %d ", a[0], b[0]); }

1,5

2,6

0,0

compiler error

Clear selection

Size of the array need not be specified when

initialization is a part of definition

it is a formal parameter

it is a declaration

all the above

Clear selection

Q2 Write a program using for loop to calculate factorial of a number OR Write a


program to print fibonacci series using recursion.

Your answer

Q3 Write a program using functions call by value and call by reference methods
both to swap the value of two variables. OR Write a program to implement binary
search in an array.

Your answer

https://docs.google.com/forms/d/e/1FAIpQLSdaZIW6mdo5AqqDAoU7QhFkYRi6LpHUHXOcCiE0k1HJw5HWgg/viewform?vc=0&c=0&w=1&flr=0&… 8/9
03/03/2022, 12:17 MID SEMESTER QUESTION PAPER PROGRAMMING IN C

Upload PDF *

Add file

Submit Clear form

Never submit passwords through Google Forms.

This content is neither created nor endorsed by Google. Report Abuse - Terms of Service - Privacy Policy

 Forms

https://docs.google.com/forms/d/e/1FAIpQLSdaZIW6mdo5AqqDAoU7QhFkYRi6LpHUHXOcCiE0k1HJw5HWgg/viewform?vc=0&c=0&w=1&flr=0&… 9/9

You might also like