Write a program that reads two arrays from the user of the same size:
Lab_Marks: contains double numbers representing the students’ lab marks
Absences: contains integer numbers representing the total absences for each student.
Compute the Result (and save in another array of same size of double data type) by subtracting Absences from the corresponding element in Lab_Marks
Sample output is here:
Lab_Marks
78.0
90.0
55.5
85.7
99.0
Absences
5
3
2
0
3
Result
73.0
87.0
53.5
85.7
96.0
#include<iostream>
using namespace std;
int main(){
double Lab_Marks[50];
int Absences[50];
for(int i=1;i<=50;++i){
cout<<"enter marks"<<endl;
cin>>Lab_Marks[i];
}
cout<<"lab marks"<<endl;
for( i=1;i<=50;++i){
cout<<"enter marks"<<endl;
cout<<Lab_Marks[i]<<endl;;
}
return 0;}
Comments
Leave a comment