728x15 Ads

bar

C....made easy by Mr. Pramod Shetty 16


#include<stdio.h>
int main(){
    int arr[3]={10,20,30};
    int x=0;
    x = ++arr[++x] + ++x + arr[--x];
    printf("%d ",x);
    return 0;
}

Answer:
              43

Explanation:     In turbo C compiler
               = ++arr[++x] + ++x + arr[--x] //x = 0 + 1
               = ++arr[++x] + ++x + arr[--x] //x = 1 + 1
               = ++arr[++x] + ++x + arr[--x] //x = 2 - 1
               = ++arr[1] + 1 + arr[1] //x = 1
               = ++arr[1] + 1 + arr[1]  //arr[1] = 20+1
               = arr[1] + 1 + arr[1] //arr[1] = 21
               = 21 + 1 + 21
               = 43
                sabse pehle hum saare incremnets ko solve karenge and solve karne ke baad jo value aaegi vo 
                value sabhi incremnets par assign hogi 
                and last mein addition perform karte hain.
Copyright © eAZy EnginEEriNG