-
-
Save mahmmoudkinawy/5103ed8e11b9e3a0f04128bb2865978a to your computer and use it in GitHub Desktop.
C++ code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main() | |
{ | |
int size = 0 ; | |
int sum = 0 ; | |
cout<<"Enter Size Of Array : "; | |
cin>>size; | |
int nums[size]; | |
for(int i = 0 ; i < size ; i++) | |
{ | |
cout<<"Enter Number To Sum : "; | |
cin>>nums[i]; | |
sum +=nums[i]; | |
} | |
cout<<"Sum = "<<sum<<endl; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment