Pythagoras Operation || Functions in C || No Arguments but Returns a value || C Programming
In this, we are going to see the Functions that have no arguments but returns a value, this program we are going to apply Pythagoras operation in C Programming Language.



#include <stdio.h>
#include <stdlib.h>
#include <math.h>

float opt()
{
    float a, b, sum;
    printf("Enter 2 numbers:-\n");
    printf("a = ");
    scanf("%f", &a);
    printf("b = ");
    scanf("%f", &b);

    sum = sqrt((a * a) + (b * b));
    return sum;
}

float main()
{
    system("cls");
    float num;
    num = opt();
    printf("Hypotenuse is:- %f", num);
    return 0;
}

//........Coded by YASH ALLAPURIA

#ENJOY CODING

Post a Comment

FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP

Previous Post Next Post