how to return a multiple value from a function?
Answers were Sorted based on User's Feedback
Answer / krishna
You will have to use a structure or an array and then return
a pointer to the structure/array.
| Is This Answer Correct ? | 3 Yes | 3 No |
what is the output of following program ? void main() { int i=5; printf("%d %d %d %d %d ",i++,i--,++i,--i,i); }
main(){ int a= 0;int b = 20;char x =1;char y =10; if(a,b,x,y) printf("hello"); }
x=2 y=3 z=2 x++ + y++; printf("%d%d" x,y);
main() { int c = 5; printf("%d", main||c); } a. 1 b. 5 c. 0 d. none of the above
#define max 5 #define int arr1[max] main() { typedef char arr2[max]; arr1 list={0,1,2,3,4}; arr2 name="name"; printf("%d %s",list[0],name); }
How do you write a program which produces its own source code as its output?
Finding a number which was log of base 2
main() { unsigned int i=10; while(i-->=0) printf("%u ",i); }
1 o 1 1 0 1 0 1 0 1 1 0 1 0 1 how to design this function format in c-language ?
Ramesh’s basic salary is input through the keyboard. His dearness allowance is 40% of basic salary, and house rent allowance is 20% of basic salary. Write a program to calculate his gross salary.
struct aaa{ struct aaa *prev; int i; struct aaa *next; }; main() { struct aaa abc,def,ghi,jkl; int x=100; abc.i=0;abc.prev=&jkl; abc.next=&def; def.i=1;def.prev=&abc;def.next=&ghi; ghi.i=2;ghi.prev=&def; ghi.next=&jkl; jkl.i=3;jkl.prev=&ghi;jkl.next=&abc; x=abc.next->next->prev->next->i; printf("%d",x); }
Predict the Output: int main() { int *p=(int *)2000; scanf("%d",2000); printf("%d",*p); return 0; } if input is 20 ,what will be print