#include<stdio.h> float salary(int,int); int main() { float sal; int i,n,hr,pr; char name[n]; printf("How many letters in your name (with space) :-\n"); scanf("%d",&n); printf("Enter your name:-"); for(int i=0;i<n;i++) scanf("%c",&name[i]); printf("Enter your working hours:"); scanf("%f",&hr); printf("Enter pay rate:"); scanf("%f",&pr); sal=salary(hr,pr); for(int i=0;i<n;i++) printf("%c",name[i]); printf("\nHour:%fPayrate:%fSalary:%f",hr,pr,sal); } float salary(int hr,int pr) { return hr*pr; }
We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy. Accept Learn more