diff options
Diffstat (limited to 'challenge-122/karishma/c++/ch1.cpp')
| -rw-r--r-- | challenge-122/karishma/c++/ch1.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/challenge-122/karishma/c++/ch1.cpp b/challenge-122/karishma/c++/ch1.cpp new file mode 100644 index 0000000000..821e88134d --- /dev/null +++ b/challenge-122/karishma/c++/ch1.cpp @@ -0,0 +1,17 @@ +#include <iostream> +using namespace std; + +int main() { + int n=5; + int ptr[]={10,20,30,40,50}; + int sum = 0; + for (int j = 1; j <= n; j++) { + sum += ptr[j-1]; + int k= sum/j; + cout<<k; + cout<<endl; + } + cout<<endl; + + return 0; +}
\ No newline at end of file |
