Tutorial-C Language-00305
Tutorial-C Language-00305
BC0034
COMPUTER CONCEPTS & C
PROGRAMMING
(1 mark each)
3) Which pair of functions below are used for single character I/O.
a) Getchar() and putchar()
b) Scanf() and printf()
c) Input() and output()
d) None of these
11) malloc() function used in dynamic allocation is available in which header file?
a) stdio.h
b) stdlib.h
c) conio.h
d) mem.h
b) :
c) NULL
d) .
15) What should be the expression return value for a do-while to terminate
a) 1
b) 0
c) -1
d) NULL
19) Which of the following header file is required for strcpy() function?
a) string.h
b) strings.h
c) files.h
d) strcsspy()
21) The conversion characters for data input means that the data item is
a) An unsigned decimal integer
b) A short integer
c) A hexadecimal integer
d) A string followed by white space
22) Which of the following is a key word is used for a storage class
a) printf
b) external
c) auto
d) scanf
26) A Link is
a) a compiler
b) an active debugger
c) a C interpreter
d) a analyzing tool in C
28) In C, a Union is
a) memory location
b) memory store
c) memory screen
d) None of these
29) When the main function is called, it is called with the arguments
a) argc
b) argv
c) None of these
d) both a & b
31) C allows arrays of greater than two dimensions, who will determined this
a) programmer
b) compiler
c) parameter
d) None of these
35) If the size of the array is less than the number of initializers then,
a) Extra values are being ignored
b) Generates an error message
c) Size of Array is increased
d) Size is neglected when values are given
5
PC Training Institute Ltd., An ISO-9001 Certified Organisation
PC TRAINING INSTITUTE LIMITED
37) A Structure
a) can be read as a single entity
b) cannot be read as a single entity
c) can be displayed as a single entity
d) has member variables that cannot be read individually
40) If you want to exchange two rows in a two dimensional array, the fastest way is to:
a) Exchange the elements of the 2rows
b) Exchange the address of each element in the two row]
c) Silence the address of the rows in an array of pointer and exchange the
pointer
d) None of these.
(2 marks each)
41) The precedence of the C operators dictates the order of evaluation within an
expression i.e. _____________ and ________________(left to right, right to left).
44) Accessing members of a union is via ________ member operator or, for pointers to
unions, the _______ operator. (.(dot), ->)
45) True/False
1. We can not write a function that returns the structure. (False)
2. We can modify a member of the structure by passing the structure as an
argument. (True)
46) True/False
1. Array is a method for packing data of different types. (False)
2. If Person1 and Person2 are variables of same type structure then expression P1>P2
is valid. (False)
47) True/False
1. Pointer is a variable containing the address of another variable. (True)
2. We can declare structure variables using tag name anywhere in program. (True)
48) A __________ operator applies to two operands, while a _________ operator applies
to a single operand. (Binary, Unary)
49) The * operator is _____________ when it sits between two variables, and it is the
___________ when it sits in the front of a single variable. (Multiplication operator,
contents-of-operator).
50) An ____ is a data structure whose elements are all of the same data type, while
______ is a data structure whose elements can differ in type. (Array, Structure).
51) True/False
1. Strings must be represented as an array of characters in C. (True)
2. When you pass an array as a parameter to a function, the entire array is copied and
is available to function. (False).
52) The standard library’s _________ function compares two strings, while ________
function copy one string to another. (strcmp, strcpy)
53) True/False
1. Complier doesn’t allocate memory for an external variable where it is accessed (T)
2. Global variables and external variables have the same scope. (False)
54) True/False
1. The main purpose of the function is to save time. (False)
2. A stopping condition must be there in a recursive definition. (True)
55) True/False
1. C Programs are highly portable. (True)
2. C compliers are commonly available for computers of all sizes. (True)
56) True/False
1. Every C program must have one main() function. (True)
2. The main () function doesn’t return any value. (False)
57) The ___________ are symbols that represent information being passed between the
function and the other parts of the program. They appear in the ___________
(arguments, function heading)
58) A _______ is a place where we can store values. Size of int is __ bits. (Variable, 16).
59) Variables consist of letters, numbers and ______________. You may not use
_________ (underscore, keyword)
60) __________ Operator can be only applied to integers. The value 14%3 + 7%2 is
___________. (%, 3)
(4 marks each)
#include <stdio.h>
#include <string.h>
main()
{
char *str1, *str2, *str3;
str1=”India is My”;
str2=”!!yrtnuoC”;
str3=”Gujrat”;
clrscr();
strncat(str1,strrev(str2),strlen(str3));
puts(str1);
}
What will be the value of n after the execution of the above program ?
a) India is My Country!!
b) India is My !!yrtnuoC
c) India is My Country
d) None of the above
What will be the value of n after the execution of the above program ?
a) I=5, k=5
b) I=4, k=4
c) I=5, k=4
d) I=4, k=5
{
sum(a);
a++;
}
void sum(int a)
{
static kk;
printf (“%d”,kk+a);
kk++;
}
What will be the value of n after the execution of the above program?
a) 02468
b) 01234
c) 13579
d) 12345
default: printf(“Odd”);
break;
}
What will be the value of n after the execution of the above program when input is 3 ?
a) ThreeFiveOdd
b) Three
c) Five
d) Odd
What will be the value of n after the execution of the above program?
a) 8
b) 6
c) 12
d) 10
What will be the value of n after the execution of the above program?
a) 5
b) 25
c) 15
d) 10
for(i=0;I<2;i++)
{
if(!(i<=n)&&(++n==i))
n=n+2;
else
n=n-2;
}
}
What will be the value of n after the execution of the above program?
a) 3
b) 4
c) 2
d) None of the above