Hi,
I have to code the program, which will calculate the percentage of the given marks. I have tried this program but getting wrong answer because my poor programing logic.
Anyone has the program in any language to find out the percentage?
Hi,
I have to code the program, which will calculate the percentage of the given marks. I have tried this program but getting wrong answer because my poor programing logic.
Anyone has the program in any language to find out the percentage?
Hi friends,
Please copy the below program code and try to run on your system, the output of the below code shows the percentage of the three numbers:
#include<conio.h>
#include<stdio.h>
void main()
{
float avgdemo(int a1,int a2,int a3);
clrscr();
printf ("percentage of 3 mark of subject : %.2f",avgdemo(88,87,75));
getch();
}
float avgdemo(int a1,int a2,int a3)
{
return (a1+a2+a3)/3;
}
Hi,
I suggest to use "avg function" of the c programming to calculate the percentage of the given program. But this "avg function" is applicable only if the given marks are out of hundred. see below:
float functionName (int num1,int num2,int num3,int num4)
{
float z = (num1+num2+num3+num4)/4;
return z;
}
Hi
I found this below code book in one of the "C" book. I tried to execute this program, and the program is running successfully without any error.
Program code:
main()
{
int x,y,z;
float abc(x, y, z);
printf("\nPercentag= %.2f", abc(50,56,89));
getch();
}
abc(int x,int y,int z)
{
int d= (m1+m2+m3)/3;
return d
}
Bookmarks