Use app×
Join Bloom Tuition
One on One Online Tuition
JEE MAIN 2025 Foundation Course
NEET 2025 Foundation Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
262 views
in Computer by (15 points)
Write a prototype of a function 'Calculate' which takes three arguments (2 int and 1 float) and returns a float value.

Please log in or register to answer this question.

1 Answer

+1 vote
by (3.7k points)

Complete code in C Programming:

#include <stdio.h>

/* function prototype */
float Calculate(int num1, int num2, float num3);

/* main function */
int main() {
    int num1, num2;
    float num3, result;
    
    /* take user input for num1, num2, and num3 */
    printf("Enter two integer numbers: ");
    scanf("%d%d", &num1, &num2);
    printf("Enter a float number: ");
    scanf("%f", &num3);
    
    /* call the Calculate function and store the result */
    result = Calculate(num1, num2, num3);
    
    /* print the result */
    printf("Result = %.2f\n", result);
    
    return 0;
}

/* function definition */
float Calculate(int num1, int num2, float num3) {
    float result;
    /* your calculation logic here */
    result = num1 * num2 * num3;  /* example calculation: multiplying all three numbers */
    return result;
}

Related questions

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...