Find Output of Program
Practice and master this topic with our carefully crafted questions.
If the size of integer is 4bytes, What will be the output of the program? |
The array elements are 5 each of size 4 bytes so it is 20.
Where as second is size of addres not the individual element so the size of int as declared is 4 so it is 4.
Then the final one is size of individual element i.e. size of first array element so it is 4.
What will be the output of the program ? |
If you compile and execute this program in windows platform with Turbo C, it will give "lice ice ce e".
It may give different output in other platforms (depends upon compiler and machine). The online C compiler given in this site will give the Option C as output (it runs on Linux platform).
What will be the output of the program ? |
For (i=0; i * (b+1) = * (b+i) +5; N=5; So * (b+1) is the second element. Thus in first iteration value of 2nd element i.e. 4 will become. For i=0; 2+5=7. i=1;then (b+1)=4+5=9. So only change 2 second element hence output : 2 15 6 8 10.
i=2;then (b+2)=6+5=11.
i=3;then (b+3)=8+5=13.
i=4;then (b+4)=10+5=15.
What will be the output of the program ? |
Pointer always store integer value so cp will store the memory address of location where string "jack " is stored.
Step 1 : vp = &ch;
/*Will store address of ch in vp so while we print content in printf it will print asccii value of 74 i.e "J"*/
Step 2 : vp = &j;
/* It will assign address of j to vp again it will print ascii value of 65 as "A"*/
Step 3 : vp = cp;
/* In this step cp is pointing to memory locatioon where string jack is stored and we r incrementing it by two so it will point to "C" from sring "JACK" and since we hava given %S in printf so it will print content from c onwords ie "CK"*/
So final combined output will be JACK.
What will be the output of the program ? |
Static variables are declared in a function so that other functions which access it from its local function cannot change the value. Only the local function can change its value. That's why its not used in function arguments.