Write a function C that represent the cost of buying alcohol a, if an alcohol cosis
P155.00
C(a)=155a
Answers
Answered by
1
Program is given below.
Explanation:
#include <stdio.h>
void c(int a);
int main()
{
int n;
printf("Enter the number of alcohols: ");
scanf("%d",&n);
c(n);
return 0;
}
//Required function
void c(int a)
{
int total;
total=155*a;
printf("Total amount of buying alcohol is equal to P%d.",total);
}
Refer the attached image for the output.
Attachments:
Similar questions