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 |
Program to Delete an element from a doubly linked list.
4 Answers College School Exams Tests, Infosys,
How to count a sum, when the numbers are read from stdin and stored into a structure?
How will u find whether a linked list has a loop or not?
Given an array of size N in which every number is between 1 and N, determine if there are any duplicates in it. You are allowed to destroy the array if you like.
21 Answers ABC, eBay, Goldman Sachs, Google, HUP, Microsoft, TATA,
Printf can be implemented by using __________ list.
How we print the table of 2 using for loop in c programing?
Which version do you prefer of the following two, 1) printf(ā%sā,str); // or the more curt one 2) printf(str);
What is "far" and "near" pointers in "c"...?
what is the output of the below program & why ? #include<stdio.h> void main() { int a=10,b=20,c=30; printf("%d",scanf("%d%d%d",&a,&b,&c)); }
main() { int a[10]; printf("%d",*a+1-*a+3); }
#include<stdio.h> main() { struct xx { int x=3; char name[]="hello"; }; struct xx *s; printf("%d",s->x); printf("%s",s->name); }
Hi, i have a project that the teacher want a pyramid of numbers in C# or java...when we click a button...the pyramid should be generated in a listbox/or JtextArea...and the pyramid should have the folowing form: 1 232 34543 4567654 567898765 67890109876 7890123210987 890123454321098 90123456765432109 0123456789876543210 Plz help with codes...didn't find anything on the net.