[Updated] Goldman Sachs Aptitude Test Questions and Answers
Practice List of TCS Digital Coding Questions !!!
Take 50+ FREE!! Online Data Interpretation Mock test to crack any Exams.

C Programming :: Arrays - Discussion

Home > C Programming > Arrays > MCQs Questions Discussion

8 / 55

What will be output of the following "c" code?

#include<stdio.h>
int main(){
int arr[]={6,12,18,24};
int x=0;
x=arr[1]+(arr[1]=2);
 printf("%d",x); return 0;
}

A4

B8

C14

D14

ECompilation error

Answer: Option (Login/Signup)

Show Explanation

x=arr[1]+(arr[1]=2); arr[1] gets modified here itself.

So, 4 will be printed.

Asked In :: Societe Generale

Post Your Answer Here:     

Reply    
Rate This: +0 -0
    Report


Report Error

Please Login First Click Here

Reply    
Rate This: +0 -2 +
    Report


Report Error

Please Login First Click Here