#include<stdio.h>
#include<stdlib.h>
void line()
{
int i,j;
printf("\n");
for(i=1;i<=42;i++)
printf("=");
}
void header()
{
printf("\n");
printf("Built and Designed by Arslan Malik\n\n www.CworldbyAS.blogspot.com");
printf("\n");
}
int main()
{
line();
header();
line();
int g,m,average,counter=1,total=0;
while (counter<=3)
{
printf("Enter number of gallons : ");
scanf("%d",&g);
printf("Enter number of miles : ");
scanf("%d",&m);
counter++;
total=total+m;
}
average=total/g;
printf("Overall Average is : %d\n\n",average);
return 0;
}
#include<stdlib.h>
void line()
{
int i,j;
printf("\n");
for(i=1;i<=42;i++)
printf("=");
}
void header()
{
printf("\n");
printf("Built and Designed by Arslan Malik\n\n www.CworldbyAS.blogspot.com");
printf("\n");
}
int main()
{
line();
header();
line();
int g,m,average,counter=1,total=0;
while (counter<=3)
{
printf("Enter number of gallons : ");
scanf("%d",&g);
printf("Enter number of miles : ");
scanf("%d",&m);
counter++;
total=total+m;
}
average=total/g;
printf("Overall Average is : %d\n\n",average);
return 0;
}
No comments:
Post a Comment