aboutsummaryrefslogtreecommitdiff
path: root/challenge-122
diff options
context:
space:
mode:
authorMohammad S Anwar <mohammad.anwar@yahoo.com>2021-10-31 22:56:10 +0000
committerMohammad S Anwar <mohammad.anwar@yahoo.com>2021-10-31 22:56:10 +0000
commitd0cebd80cc7e14c210eca968269cfe7127d75904 (patch)
treeef00f783978e71e581e71c1f979f2fd58a3d8f1f /challenge-122
parent2b4ad0c33ef7f19267d4c664f368a9edbb321ac2 (diff)
downloadperlweeklychallenge-club-d0cebd80cc7e14c210eca968269cfe7127d75904.tar.gz
perlweeklychallenge-club-d0cebd80cc7e14c210eca968269cfe7127d75904.tar.bz2
perlweeklychallenge-club-d0cebd80cc7e14c210eca968269cfe7127d75904.zip
- Added guest contributions to week 122 by Karishma Rajput.
Diffstat (limited to 'challenge-122')
-rw-r--r--challenge-122/karishma/C/ch-1.c30
-rwxr-xr-xchallenge-122/karishma/c++/ch1bin17320 -> 0 bytes
-rw-r--r--challenge-122/karishma/c/ch-1.c2
-rw-r--r--challenge-122/karishma/cpp/ch1.cpp (renamed from challenge-122/karishma/c++/ch1.cpp)0
4 files changed, 2 insertions, 30 deletions
diff --git a/challenge-122/karishma/C/ch-1.c b/challenge-122/karishma/C/ch-1.c
deleted file mode 100644
index d52a21d311..0000000000
--- a/challenge-122/karishma/C/ch-1.c
+++ /dev/null
@@ -1,30 +0,0 @@
-#include <stdio.h>
-#include<stdlib.h>
-
-int main() {
- int n=0;
- int* ptr;
- printf("Enter total number of inputs to be entered: ");
- scanf("%d", &n);
- ptr = (int*)calloc(n, sizeof(int));
- if (ptr == NULL) {
- printf("Memory not allocated.\n");
- exit(0);
- }
- else {
- for (int i = 1; i <= n; i++) {
- int temp=0;
- scanf("%d",&temp);
- ptr[i] = temp;
- }
- printf("\n");
- }
- int sum = 0;
- for (int j = 1; j <= n; j++) {
- sum += ptr[j];
- printf("%d ", sum / j);
- }
- printf("\n");
- free(ptr);
- return 0;
-} \ No newline at end of file
diff --git a/challenge-122/karishma/c++/ch1 b/challenge-122/karishma/c++/ch1
deleted file mode 100755
index 97181945e7..0000000000
--- a/challenge-122/karishma/c++/ch1
+++ /dev/null
Binary files differ
diff --git a/challenge-122/karishma/c/ch-1.c b/challenge-122/karishma/c/ch-1.c
index 0dda717765..d52a21d311 100644
--- a/challenge-122/karishma/c/ch-1.c
+++ b/challenge-122/karishma/c/ch-1.c
@@ -1,4 +1,6 @@
#include <stdio.h>
+#include<stdlib.h>
+
int main() {
int n=0;
int* ptr;
diff --git a/challenge-122/karishma/c++/ch1.cpp b/challenge-122/karishma/cpp/ch1.cpp
index 821e88134d..821e88134d 100644
--- a/challenge-122/karishma/c++/ch1.cpp
+++ b/challenge-122/karishma/cpp/ch1.cpp