Question

Write a function prototype and a function definition for a function called Numbers that takes three arguments by reference, a
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Code:

#include <stdio.h>

//the below statement is a function prototype for Numbers

void Numbers(long *a,long *b,long *c);

int main(void) {

//you can call the function after giving the prototype

long int1=92233720368543;

long int2=92233720368542;

long int3=92233720368541;

//calling the function by using reference

Numbers(&int1,&int2,&int3);

return 0;

}

//Here is the function definition

void Numbers(long *a,long *b,long *c){

//calculating sum

long sum=*a+*b+*c;

printf("Sum: %ld\n",sum);

//calculating average and priting

printf("Average: %ld\n",sum/3);

//code to decide the Largest

if(*a>*b && *a>*c){

printf("Largest: %ld\n",*a);

}else if(*b>*a && *b>*c){

printf("Largest: %ld\n",*b);

}else{

printf("Largest: %ld\n",*c);

}

}

output:

Sum: 276701161105626
Average: 92233720368542
Largest: 92233720368543


Please give it thumbsup and comment below for any problem in the answer

Add a comment
Know the answer?
Add Answer to:
Write a function prototype and a function definition for a function called Numbers that takes three...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT