Jump to content

error in small code


qwe010

Recommended Posts

hi all

i Found  this code   
i Tried to compiled it   
but he show error 
It needs to be some minor adjustments 

[code]#include <stdio.h>
#include <conio.h>
float average(float ary, float count)
{
float tot = 0.0;
        int i;

        for(i = 0; i < count; i++)
                tot += ary;

        return(tot / count);
}
int main()

{

printf("\n\t\t\t****************************
printf("\t\t\t****************************
printf("\t\t\t******** L-G-H Team ********
printf("\t\t\t****************************
printf("\t\t\t****************************
printf("\t\t            the result is %f\n", average(5.5, 3.5));
printf("\t\t\t        you got it :D\n\n");
printf(" press any key to exit...

getch();
return 0;
}[/code]

please
Link to comment
https://forums.phpfreaks.com/topic/22060-error-in-small-code/
Share on other sites

This is the output of the program


                        ****************************
                        ****************************
                        ******** L-G-H Team ********
                        ****************************
                        ****************************
                            the result is 6.285714
                                you got it :D

press any key to exit...



Link to comment
https://forums.phpfreaks.com/topic/22060-error-in-small-code/#findComment-103156
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.