Array sizes are optional during array declaration by using ______ keyword.
1.auto
2.static
3.extern
4.register
Associativity of an operator is _______
1.Right to Left
2. Left to Right
3.Random fashion
4.Both Right to Left and Left to Right
Automatic variables are allocated memory in ____
1. heap
2.Data segment
3.Code segment
4.stack
Automatic variables are initialized to __
1.Zero
2. Junk value
3.Nothing
4.Both Zero & Junk value
Automatic variables are _________
1.Declared within the scope of a block, usually a function
2. Declared outside all functions
3.Declared with the auto keyword
4.Declared within the keyword extern
What is the default return type if it is not specified in function definition?
1.void
2. int
3.double
4.short int
Can we use a function as a parameter of another function? [Eg: void wow(int func())].
1.Yes, and we can use the function value conveniently
2.Yes, but we call the function again to get the value, not as convenient as in using variable
3.No, C does not support it
4.This case is compiler dependent
Comment on the following statement. n = 1;printf("%d, %dn", 3*n, n++);
1.Output will be 3, 2
2.Output will be 3, 1
3.Output will be 6, 1
4.Output is compiler dependent
Functions can return enumeration constants in C?
1.TRUE
2. false
3.depends on the compiler
4.depends on the standard
Functions can return structure in C?
1.TRUE
2.FALSE
3.Depends on the compiler
4.Depends on the standard
Functions in C are always _____
1.Internal
2. External
3.Both Internal and External
4.External and Internal are not valid terms for functions
Global variables are _______
1.Internal
2.External
3.Both Internal and External
4.None of the mentioned
In expression i = g() + f(), first function called depends on ______
1.Compiler
2.Associativiy of () operator
3.Precedence of () and + operator
4. Left to write of the expression
In expression i = g() + f(), first function called depends on _________
1.Compiler
2.Associativiy of () operator
3.Precedence of () and + operator
4.Left to write of the expression
What will be the value of the following assignment expression? (x = foo())!= 1 considering foo() returns 2
1.2
2. True
3.1
4.0
Operation “a = a * b + a” can also be written as ___________
1.a *= b + 1;
2.(c = a * b)!=(a = c + a);
3.a = (b + 1)* a;
4.All of the mentioned
Register variables reside in ________
1.stack
2.registers
3.heap
4.main memory
The C code ‘for(;;)’ represents an infinite loop. It can be terminated by ______
1.break
2.exit(0)
3.abort()
4. terminate
The keyword ‘break’ cannot be simply used within ______
1.do-while
2.if-else
3.for
4. while
The value obtained in the function is given back to main by using ________ keyword.
1.return
2.static
3.new
4.volatile
What is the return-type of the function sqrt()?
1.int
2.float
3.double
4.depends on the data type of the parameter
What is the scope of an automatic variable?
1.Exist only within that scope in which it is declared
2.Cease to exist after the block is exited
3.Exist only within that scope in which it is declared & exist after the block is exited
4.All of the mentioned
What will be the final value of c in the following C statement? (Initial value: c = 2) c <<= 1;
1.c = 1;
2.c = 2;
3.c = 3;
4.c = 4;
When compiler accepts the request to use the variable as a register?
1.It is stored in CPU
2.It is stored in cache memory
3.It is stored in main memory
4.It is stored in secondary memory
Where in C the order of precedence of operators do not exist?
1.Within conditional statements, if, else
2.Within while, do-while
3. Within a macro definition
4. None of the mentioned
Which among the following is the correct syntax to declare a static variable register?
1.static register a;
2. register static a;
3.Both static register a; and register static a;
4.We cannot use static and register together
Which data type can be stored in register?
1.int
2.long
3. float
4.all of the mentioned
Which for loop has range of similar indexes of ‘i’ used in for (i = 0;i < n; i++)?
1.for (i = n; i>0; i–)
2.for (i = n; i >= 0; i–)
3. for (i = n-1; i>0; i–)
4.for (i = n-1; i>-1; i–)
Which function in the following expression will be called first? a = func3(6) - func2(4, 5) / func1(1, 2, 3);
1.func1();
2. func2();
3. func3();
4.Cannot be predicted
Which keyword can be used for coming out of recursion?
1.break
2. return
3.exit
4.both break and return
Which keyword is used to come out of a loop only for that iteration?
1.break
2.continue
3.return
4.none of the mentioned
Which of following is not accepted in C?
1.static a = 10; //static as
2.static int func (int); //parameter as static
3.static static int a; //a static variable prefixed with static
4.all of the mentioned
Which of the following are unary operators?
1.sizeof
2. –
3.++
4.all of the mentioned
Which of the following cannot be static in C?
1.Variables
2.Functions
3.Structures
4.None of the mentioned
Which of the following cannot be used as LHS of the expression in for (exp1;exp2; exp3)?
1.variable
2.function
3.typedef
4.macros
Which of the following function declaration is illegal?
1.int 1bhk(int);
2. int 1bhk(int a);
3.int 2bhk(int*, int []);
4. all of the mentioned
Which of the following is a correct format for declaration of function?
1. return-type function-name(argument type);
2.return-type function-name(argument type){}
3.return-type (argument type)function-name;
4.all of the mentioned
Which of the following is a ternary operator?
1.&&
2.>>=
3.?:
4.->
Which of the following is an invalid assignment operator?
1.a %= 10;
2.a /= 10;
3.a |= 10;
4.None of the mentioned
Which of the following is an invalid if-else statement?
1.if (if (a == 1)){}
2. if (func1 (a)){}
3.if (a){}
4.if ((char) a){}
Which of the following is NOT possible with any 2 operators in C?
1.Different precedence, same associativity
2.Different precedence, different associativity
3.Same precedence, different associativity
4.All of the mentioned
Which of the following is possible with any 2 operators in C?
1.Same associativity, different precedence
2.Same associativity, same precedence
3.Different associativity, different precedence
4.All of the mentioned
Which of the following is the correct order of evaluation for the given expression? a = w % x / y * z;
1. % / * =
2. / * % =
3. = % * /
4. * % / =
Which of the following method is accepted for assignment?
1.5 = a = b = c = d;
2.a = b = c = d = 5;
3.a = b = 5 = c = d;
4.None of the mentioned
Which of the following operation is not possible in a register variable?
1.Reading the value into a register variable
2.Copy the value from a memory variable
3.Global declaration of register variable
4.All of the mentioned
Which of the following operator has the highest precedence in the following?
1.()
2.sizeof
3.*
4.+
Which of the following operators has an associativity from Right to Left?
1.<=
2. <<
3.==
4.+=
Which of the following option is the correct representation of the following C statement? e = a * b + c / d * f;
1.e = (a * (b +(c /(d * f))));
2. e = ((a * b) + (c / (d * f)));
3.e = ((a * b) + ((c / d)* f));
4.Both e = ((a * b) + (c / (d * f))); and e = ((a * b) + ((c / d)* f));
Which of the following storage class supports char data type?
1.register
2.static
3.auto
4.all of the mentioned
Which operators of the following have same precedence? P. "!=", Q. "+=", R. "<<="
1.P and Q
2.Q and R
3.P and R
4.P, Q and R