what will be the output of this program?
void main()
{
int a[]={5,10,15};
int i=0,num;
num=a[++i] + ++i +(++i);
printf("%d",num);
}
Answers were Sorted based on User's Feedback
Answer / viswanath
Ans: 15.
Exp: a[++i] means i = 1; so 10 + 2 +3
Is This Answer Correct ? | 7 Yes | 1 No |
Answer / nandkishor
Ans: 19.
Explanation: First expression (++i) execute. Hence i=1;
Than a[++i]=a[2]=15.
And than ++i=3.
Hence evaluation will be 15+3+1=19.
Note that expression closed in braces have high precedence.
Is This Answer Correct ? | 0 Yes | 0 No |
Write a program using one dimensional array to assign values and then display it on the screen. Use the formula a[i]=i*10 to assign value to an element.
1 Answers Samar State University,
x=2 y=3 z=2 x++ + y++; printf("%d%d" x,y);
abcdedcba abc cba ab ba a a
Write a program to check whether the number is prime and also check if it there i n fibonacci series, then return true otherwise return false
main() { int i=5,j=6,z; printf("%d",i+++j); }
There are 21 people in a room. They have to form groups of 3 people each. How many combinations are possible? Write a C program to print the same.
Write a program to model an exploding firecracker in the xy plane using a particle system
Printf can be implemented by using __________ list.
#include<stdio.h> main() { int a[2][2][2] = { {10,2,3,4}, {5,6,7,8} }; int *p,*q; p=&a[2][2][2]; *q=***a; printf("%d..%d",*p,*q); }
#include<stdio.h> main() { struct xx { int x; struct yy { char s; struct xx *p; }; struct yy *q; }; }
write a c program to input initial & final time in the format hh:mm and find the time intervel between them? Ex inputs are initial 06:30 final 00:05 and 23:22 final 22.30
Sir... please give some important coding questions asked by product companies..