In the following 'C' code, in which order the functions would be called ?
a = ( f1(23,14 ) * f2 (12/14)) + f3 () ;
A. | f1,f2,f3 |
B. | f3,f2,f1 |
C. | The order may vary from compiler to compiler |
D. | None of these |
Option: A Explanation : Click on Discuss to view users comments. sujit said: (8:12pm on Sunday 1st December 2013)
Wrong.In Airthmatic expression the ( ) tell compiler which oerands go with operators but do not force comiler to evaluate every () first.So, Ans should be 'C'
Manjusha said: (10:25am on Saturday 5th November 2016)
According to precedence and associativity rules * must be executed first and then .So, option A is correct
sonali manohar shelke said: (8:12am on Monday 18th December 2017)
Multiplication has highest priority in operator precedence and then hence option A is correct
|
What error would the following function give on compilation ?
f(int a,int b)
{
int a;
a = 20;
return a;
}
A. | Missing parentheses in return statement |
B. | Function should be define as int f(int a,int b) |
C. | Redeclaration of a |
D. | No error |
Option: C Explanation : Click on Discuss to view users comments. sonali manohar shelke said: (8:19am on Monday 18th December 2017)
As int a is already declared in formal parameter and it again declared inside the function body so option c is correct answer
|
A. | Returns an integer |
B. | Returns a non-integer value |
C. | Is not defined in the same file |
D. | None of these |
Option: B Explanation : Click on Discuss to view users comments. |
What will be the value retuned by the following function, when it is called with a value 11?
recur(int num)
if ( ( num/2) !=0 )
return ( recur(num/2 ) * 10+num%2 );
else return 1;
A. | Function does not return any value, because it goes into an infinite loop |
B. | 11 |
C. | 1011 |
D. | None of these |
Option: C Explanation : Click on Discuss to view users comments. |
Syllabus Covered in this section is
This Section covers Multiple Choice Questions Answers in C Programming . Here questions answers are given with explanation and references. These questions can be used for the preparation of various competitive and academic exams.
Who can benefit -
Various Search Terms used for this section are