Home Basic Loop Array string Function Pointer Contact STUDY

AHF    C    PROGRAM    SOLVING

Programming tips

Specifer



Test expression



Comment



Header file



Iterative statement




Function_ find large number




// AHF C PROGRAM SOLVING

//The problem are solving here using FUNCTION

#include<stdio.h> #include<math.h> #define pf printf //function declaration int fact(int x, int y, int z); void main() { int a,b,c,res; //taking values printf("Enter the first number: "); scanf("%d",&a); printf("Enter the second number: "); scanf("%d",&b); printf("Enter the third number: "); scanf("%d",&c); //function call res=fact(a,b,c); printf("\nThe largest number among %d, %d and %d is: %d",a,b,c,res); return 0; } //function definition int fact(int x, int y, int z) //function header //function body { return (x>y?(x>z?x:z):(y>z?y:z)); //return answer }
OUTPUT:


© 2018 - All rights reserved