main()
{
int i = 1;
int num[] = {1,2,3,4};
num[i] = i++;
printf("%d", num[i]);
}
what will be the output?
}
Answers were Sorted based on User's Feedback
Answer / mortal
num[i] is num[1] and its reassigned as i++ that is 1 thus it
will print 1.
but im not at all sure about this..
| Is This Answer Correct ? | 2 Yes | 10 No |
Answer / sathya
num[i]=i+1
num[1]=1+1=2, but num[1] is 1.so there is a error...
| Is This Answer Correct ? | 4 Yes | 13 No |
write a program to print sum of each row of a 2D array.
Which is more efficient, a switch statement or an if else chain?
How will you print TATA alone from TATA POWER using string copy and concate commands in C?
0 Answers Amdocs, Apps Associates,
value = 0xabcd; for (loop = 1; (value >> 1) & 1 | loop & 1; loop++) { foo(); if (loop & 1) value >>= 1; } how many times is foo() executed?
create a C program that displays one z,two y's,three x's until twenty six A's. plzz answer i need it tomorrow.
illustrate the use of address operator and dereferencing operator with the help of a program guys plzzz help for this question
How can a program be made to print the line number where an error occurs?
What does char * * argv mean in c?
What is the difference between malloc calloc and realloc in c?
Why is extern used in c?
how to get the starting address of file stored in harddisk through 'C'program.
Just came across this question, felt worth sharing, so here it is I want you to make a C/C++ program that for any positive integer n will print all the positive integers from 1 up to it and then back again! Let's say n=5 I want the program to print: 1 2 3 4 5 4 3 2 1. Too easy you say? Okay then... You can ONLY USE: 1 for loop 1 printf/cout statement 2 integers( i and n) and as many operations you want. NO if statements, NO ternary operators, NO tables, NO pointers, NO functions!