main()
{
int i=_l_abc(10);
printf("%d\n",--i);
}
int _l_abc(int i)
{
return(i++);
}
Answers were Sorted based on User's Feedback
Answer / susie
Answer :
9
Explanation:
return(i++) it will first return i and then increments. i.e.
10 will be returned.
Is This Answer Correct ? | 7 Yes | 1 No |
Post increment - perform operation first , then increment
In function call _l_abc its post increment, so after value 10 to be returned is decided , local variable i is increment , its i in function.
Variable i in _l_abc is different than i in main.
Post decrement : decrement first then perform operation.
In main its pre decrement , returned 10 is decremented to 9, then printed.
Now , unless compiler does not throw error of beginning function name with _ , 9 is printed.
Is This Answer Correct ? | 1 Yes | 1 No |
Write a C function to search a number in the given list of numbers. donot use printf and scanf
How do you verify if the two sentences/phrases input is an anagram using predefined functions in string.h and by using arrays?
#include<stdio.h> main() { FILE *ptr; char i; ptr=fopen("zzz.c","r"); while((i=fgetch(ptr))!=EOF) printf("%c",i); }
int main() { int x=10; printf("x=%d, count of earlier print=%d", x,printf("x=%d, y=%d",x,--x)); getch(); } ================================================== returns error>> ld returned 1 exit status =================================================== Does it have something to do with printf() inside another printf().
how can u draw a rectangle in C
53 Answers Accenture, CO, Codeblocks, Cognizant, HCL, Oracle, Punjab National Bank, SAP Labs, TCS, University, Wipro,
struct point { int x; int y; }; struct point origin,*pp; main() { pp=&origin; printf("origin is(%d%d)\n",(*pp).x,(*pp).y); printf("origin is (%d%d)\n",pp->x,pp->y); }
1 o 1 1 0 1 0 1 0 1 1 0 1 0 1 how to design this function format in c-language ?
#define a 10 void foo() { #undef a #define a 50 } int main() { printf("%d..",a); foo(); printf("%d..",a); return 0; } explain the answer
Printf can be implemented by using __________ list.
what is the code of the output of print the 10 fibonacci number series
int i=10; main() { extern int i; { int i=20; { const volatile unsigned i=30; printf("%d",i); } printf("%d",i); } printf("%d",i); }
#include"math.h" void main() { printf("Hi everybody"); } if <stdio.h> will be included then this program will must compile, but as we know that when we include a header file in "" then any system defined function find its defination from all the directrives. So is this code of segment will compile? If no then why?