CODE
#include <iostream.h>
#include <stdlib.h>
Int main ()
{ system (“CLS”)
;
Float marks
[50] ;
For (
int I = 0 ; I < 50 ; ++ I ; ) ;
{ cout
<<” Enter the marks of students “<< I + 1 << “ : “ ;
Cin >>
makrs[ I ] ;
}
Cout <<”\n”
;
For ( I
= 0 ; I < 50 ; ++ I )
Cout <<”
Marks [“<< I <<” ] = “ << marks[ I ] << “\n” ;
Return 0 ;
}
your code had so many mistakes and i edit that. here is executable cod :
ReplyDelete#include
#include
int main ()
{
int marks[50];
for (int i=0; i<50; ++i)
{
std::cout << "Enter the marks of students #"<< i + 1 << ":";
std::cin >> marks[i];
std::cin.ignore(32767, '\n');
}
std::cout <<"\n";
for (int i=0; i<50; ++i)
std::cout <<"Marks ["<< i <<"] = " << marks[i] << "\n";
return 0 ;
}
may need validating prior to storing it no?
ReplyDeletehow to catch errors and display them (say if one mark is being misstyped or missing info in the file)