Addition program in a CPP Language
How to add Five numbers with Cpp programming?
#include<conio.h>
using namespace std;
int main ()
{
int foo [5] = {16, 2, 77, 40, 12071};
int n, result=0;
for ( n=0 ; n<5 ; ++n )
{
result += foo[n];
}
cout << result;
getch();
}
Comments
Post a Comment