i keep getting error message #include #include #define element 10 using namespace std; void input(float array); void pay_rise(float arra); void display(float arra); void largest_number(float arra); int main() { float array[element]; input(array); pay_rise(array); display(array); largest_number(array); return 0; } void input(float array[]) { int n; for(n=0;n < element;n++) { printf("enter salaries %d",n); scanf("%f",&array[n]); } } void pay_rise(float array[]) { int n; for(n=0; n < element;n++) { array[n] = array[n] + (array[n]*20/100); } } void display(float array[]) { int n; printf(" new pay\n"); for (n=0; n < element ;n++) { printf("pay %d is %f\n",n,array[n]); } } void largest_number(float array[]) { int n; float largest = array[0]; int index = 0; for (n=0; n < element; n++) { if (array[n] < largest) { largest = array[n]; index = n; } } printf("largest salary is %f index %d\n", largest,index); }
i keep getting error message
#include <iostream>
#include <stdio.h>
#define element 10
using namespace std;
void input(float array);
void pay_rise(float arra);
void display(float arra);
void largest_number(float arra);
int main()
{
float array[element];
input(array);
pay_rise(array);
display(array);
largest_number(array);
return 0;
}
void input(float array[])
{
int n;
for(n=0;n < element;n++)
{
printf("enter salaries %d",n);
scanf("%f",&array[n]);
}
}
void pay_rise(float array[])
{
int n;
for(n=0; n < element;n++)
{
array[n] = array[n] + (array[n]*20/100);
}
}
void display(float array[])
{
int n;
printf(" new pay\n");
for (n=0; n < element ;n++)
{
printf("pay %d is %f\n",n,array[n]);
}
}
void largest_number(float array[])
{
int n;
float largest = array[0];
int index = 0;
for (n=0; n < element; n++)
{
if (array[n] < largest)
{
largest = array[n];
index = n;
}
}
printf("largest salary is %f index %d\n", largest,index);
}
The problem is based on the basics of functions in C++ programming language.
Step by step
Solved in 3 steps with 1 images