# Thread: Problem In Function Program

1. ## Problem In Function Program

I have been given an assignment

"Task:- Write a function that accept a person salary in long integer, rate of interest & return the yearly investment "

I have made a following program!

Code:
```#include<stdio.h>
#include<conio.h>
float inve(long,long);
float inte(long,long);
float sum(long,long);
void main(void)
{
clrscr();
long c;
long a;
long b;
printf("Enter The Monthly Salary Of A Person:");
scanf("%ld",&a);
printf("Enter The Rate Of Interest Of A Person:");
scanf("%ld",&b);
printf("\nThe Rate In A Numbers:%ld",inve(a,b));
printf("\nThe Difference Of Interest And A Salary %ld",inte(a,b));
printf("\nThe Yearly Investment Is %ld",sum(c,b));
getche();
}
float inve(long x,long y)
{
return((y/100)*x);
}
int inte(long w,long v)
{
return(w-v);
}
int sum(long q,long r)
{
return((q+r)*12));
}```

2. First, you need to learn how to properly indent source code. This will make it easier for others to read.

Next, instead of just asking for what mistakes you've made, tell us what output you expect to get and how that is different from the output you are getting.

3. Give your functions and variables (especially) meaningful names.

a and b are useless.
salary and interest would be better.

4. Sorry Friends, I am new to Programming that is why, I am amking mistakes in following rules of this forums and writing programs in a meaningful way!