Problem Description
Print the sum of 6 numbers using array and pointersCODING ARENA::
#include <stdio.h>
int main()
{
int a,sum=0,i;
for(i=0;i<6;i++)
{
scanf("%d",&a);
sum=sum+a;
}
printf("%d",sum);
return 0;
}
Test Case 1
Input (stdin)1 2 3 4 5 6
Expected Output21
Test Case 2
Input (stdin)1 1 1 2 2 2
Expected Output9
No comments:
Post a Comment