how to return a multiple value from a function?

Answers were Sorted based on User's Feedback



how to return a multiple value from a function?..

Answer / tanish

Use an array
int [] funct1();

Is This Answer Correct ?    3 Yes 0 No

how to return a multiple value from a function?..

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

Post New Answer

More C Code Interview Questions

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.

1 Answers   TCS,


void main() { int k=ret(sizeof(float)); printf("\n here value is %d",++k); } int ret(int ret) { ret += 2.5; return(ret); }

1 Answers  


main() { int i=5; printf(ā€œ%dā€,i=++i ==6); }

1 Answers  


How do I write a program to print proper subset of given string . Eg :input: abc output:{},{a},{b},{c},{a,b},{a,c},{b,c}, {a,b,c}.I desperately need this program please mail me to saravana6m@gmail.com

11 Answers   Deshaw, Infosys,


main() { int *j; { int i=10; j=&i; } printf("%d",*j); }

9 Answers   HCL, Wipro,






Write a complete program that consists of a function that can receive two numbers from a user (M and N) as a parameter. Then print all the numbers between the two numbers including the number itself. If the value of M is smaller than N, print the numbers in ascending flow. If the value of M is bigger than N, print the numbers in descending flow. may i know how the coding look like?

2 Answers  


main() { char *p="hai friends",*p1; p1=p; while(*p!='\0') ++*p++; printf("%s %s",p,p1); }

3 Answers  


Printf can be implemented by using __________ list.

3 Answers  


void main() { int i; char a[]="\0"; if(printf("%s\n",a)) printf("Ok here \n"); else printf("Forget it\n"); }

3 Answers   Accenture,


why the range of an unsigned integer is double almost than the signed integer.

1 Answers  


main() { int i=10,j=20; j = i, j?(i,j)?i:j:j; printf("%d %d",i,j); }

2 Answers   Adobe, CSC,


main() { int c = 5; printf("%d", main||c); } a. 1 b. 5 c. 0 d. none of the above

2 Answers   HCL,


Categories