Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

manish kumar verma mnnit allahabad

#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;
}

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.