Anda di halaman 1dari 8

Q.1 Multiple Choice Questions!!

(20 Marks)

1. Who is father of C Language?


Bjarne Stroustrup James Gosling
Dennis Ritchie Dr. E.F. Codd

2. C programs are converted into machine language with the help of


An Editor A Compiler
An Operating System None of these

3. Standard ANSI C recognizes ______ number of keywords?


30 32
24 36

4. What is the difference between a declaration and a definition of a variable?


Both can occur multiple times, but a declaration must occur first.
A definition occurs once, but a declaration may occur many
times A declaration occurs once, but a definition may occur
many times.
There is no difference between them.

5. A single line comment in C language source code can begin with _____
-; (B) - :
- /* - //

6. C programming : If you want to store dissimilar data together, then which type you will use?
array structure
stack None of the above

7. What is the default return-type of getchar()? (C programming)


char int
char * Reading character doesn't require a return-type

8. Which of the following cannot be checked in a switch-case statement?


(C programming)
Character Integer
Float enum

9. The function that calls itself for its processing is known as.
(C programming)
Inline Function Nested Function
SWD-ALC EXAM / C PROG/ FEB2019 PAPER CODE 201902

Overloaded Function Recursive Function


10.Array index always start from
(C programming)

0 1
2 3

11.C programming: Which is not a storage class?


Auto Struct
Typedef Static

12. C programming: The default parameter passing mechanism is called as


function call call by value.
call by reference. None of the above

13. Which of the following is correct about structure in c++?


structure does not support inheritance but class supports.
class data members are private by default while structures are public by default.
structure cannot be declared as abstract.
All of the above.

14. Libray function getch() belongs to which header file?


stdio.h conio.h
stdlib.h stdlibio.h

15. What is meaning of below lines?


void sum (int, int);
sum is function which takes int arguments
sum is a function which takes two int arguments and returns void
it will produce compilation error
Can't comment

16. How many loops are there in C


2 3
4 1

17. What is size of() in C?


Operator Function
Macro None of these

18. How many main() function we can have in our project?


1 2
No Limit Depends on Compiler
SWD-ALC EXAM / C PROG/ FEB2019 PAPER CODE 201902

19)Is it possible to run program without main() function?


Yes No
20)
ptr is an array of pointers to 10 integers ptr is a pointer to an array of 10
integers ptr is an array of 10 integers Invalid statement

Q.-2) Write a c Program to swap the two values using function. (10 Marks)

Q.-3) Write a Factorial Program using Recursion Function. (5 Marks)

Q.-4) Write a Program For Fibonancci Series. (5 Marks)

Q-5) Write the output for the following code. (10 Marks)

1. void main()
{
printf("%d",-5%3);
}

a. 1
b. 2
c. -2
d. 2.5

2. void main()
{
int x=300*400/300;
printf("%d",x);
}

a. 300
b. None of these
c. 400
d. 100

3. #include< stdio.h>
void i(int *a,int *b)
{ a=b;
*a=2; }
int
x=0,y=1;
SWD-ALC EXAM / C PROG/ FEB2019 PAPER CODE 201902

int main()
{
i(&x,&y);
\
return 0;
}

- Published on 16 Jun 15

a. 22
b. 21
c. 02
d. 01

4. #include <stdio.h>
main()
{ char
*p = 0; *p
= 'a';
printf("value in pointer p is %c\n", *p);
}
a) It will print a
b) It will print 0
c) Compile time error
d) Run time error

5. #include <stdio.h>
main()
{ if (sizeof(int)
> -1)
printf("True");
else
printf("False");
}
a) True
b) False

6. #include <stdio.h>
main()
{
int n = 0, m = 0;
if (n > 0) if (m >
0)
printf("True"); else
printf("False");
}
a) True
SWD-ALC EXAM / C PROG/ FEB2019 PAPER CODE 201902

b) False
c) No Output will be printed
d) Run Time Error
7. #include <stdio.h>
void main()
{ int x = 0; int
*ptr = &x;
printf("%p\n", ptr);
ptr++; printf("%p\n
", ptr);
}
a)0xbfd605e80xbfd605ec
b)0xbfd605e80cbfd60520
c)0xbfd605e80xbfd605e9
d) Run time error

8. #include <stdio.h>
int main()
{ int i = 0;
while (i = 0)
printf("True\n");
printf("False\n");
}
a)True(infinitetime)
b)True(1time)False
c)False
d) Compiler dependent

9. #include <stdio.h>
struct temp
{ int
a; int b;
int c; }
p[] = {0};
main()
{
printf("%d", sizeof(p));
}
a) 4
b) 12
c) 16

10) #include <stdio.h>


struct student
{
SWD-ALC EXAM / C PROG/ FEB2019 PAPER CODE 201902

char *name;
};
void main()
{
struct student s[2], r[2];
s[1] = s[0] = "alan";
printf("%s%s", s[0].name, s[1].name);
}
a)alanalan
b)Nothing
c)Compiletimeerror
d) Varies

_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
____________________________________________________________________________________

_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
____________________________________________________________________________________

_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
____________________________________________________________________________________

_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
____________________________________________________________________________________

_____________________________________________________________________________________
SWD-ALC EXAM / C PROG/ FEB2019 PAPER CODE 201902

_____________________________________________________________________________________
_____________________________________________________________________________________
____________________________________________________________________________________

_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
____________________________________________________________________________________

_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
____________________________________________________________________________________

_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
____________________________________________________________________________________

_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
____________________________________________________________________________________

_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
____________________________________________________________________________________

_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
____________________________________________________________________________________

_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
____________________________________________________________________________________

_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
SWD-ALC EXAM / C PROG/ FEB2019 PAPER CODE 201902

____________________________________________________________________________________

_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
____________________________________________________________________________________

_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
____________________________________________________________________________________

_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
____________________________________________________________________________________

_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
____________________________________________________________________________________

_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
____________________________________________________________________________________

_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
____________________________________________________________________________________

_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
____________________________________________________________________________________

_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
____________________________________________________________________________________

_____________________________________________________________________________________
_____________________________________________________________________________________

Anda mungkin juga menyukai