how to return a multiple value from a function?
Answers were Sorted based on User's Feedback
#include<stdio.h>
#define PI 3.1415
int main()
{
double area,perimeter,radius;
printf("Enter radius of Circle:");
scanf("%lf",$radius);
calculate(&area,&perimeter,radius);
printf("Area of Circle:%lf\nPerimeter of
Circle:%lf",area,perimeter);
}
calculate(double *a,double *p,double r)
{
*a=PI*r*r;
*p=2*PI*r;
}
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / ara
string f()
{
return "a multiple value";
}
:) if this a trick question ...
| Is This Answer Correct ? | 1 Yes | 4 No |
Answer / vinayakkatkar
using if else statement
for example
int fun()
{
if(cond1)
return var1;
else
return var2;
}
| Is This Answer Correct ? | 1 Yes | 7 No |
Write a routine to implement the polymarker function
why nlogn is the lower limit of any sort algorithm?
what is the code of the output of print the 10 fibonacci number series
what will be the position of the file marker? a: fseek(ptr,0,SEEK_SET); b: fseek(ptr,0,SEEK_CUR);
How to access command-line arguments?
Find your day from your DOB?
15 Answers Accenture, Microsoft,
Write a procedure to implement highlight as a blinking operation
how to delete an element in an array
main() { int i; printf("%d",scanf("%d",&i)); // value 10 is given as input here }
main() { char p[ ]="%d\n"; p[1] = 'c'; printf(p,65); }
Design an implement of the inputs functions for event mode
main() { unsigned int i=10; while(i-->=0) printf("%u ",i); }