0

Please tell me the correction in this program ...

#include<iostream> void main() { int anArray[3]; anArray[0]=2; anArray[1]=3; anArray[2]=4; int nSum=anArray[0]+anArray[1]+anArray[2]; cout<<"The sum is "<<nSum<<endl; }

12th Feb 2017, 7:22 AM
Saksham
Saksham - avatar
3 Réponses
+ 7
All of you forgotten to return 0 but it's just a minor problem so nvm :x
12th Feb 2017, 10:26 AM
Hatsy Rei
Hatsy Rei - avatar
+ 6
you forgot the library: using namespace std;
12th Feb 2017, 10:17 AM
Arton Hoti
+ 4
#include<iostream> using namespace std; int main() { int anArray[3]; anArray[0]=2; anArray[1]=3; anArray[2]=4; int nSum=anArray[0]+anArray[1]+anArray[2]; cout<<"The sum is "<<nSum<<endl; }
12th Feb 2017, 9:07 AM
Mario L.
Mario L. - avatar