Thursday, December 5, 2013

C Programming Basic #2: C Programming.....How many integers you want to ad...

C Programming Basic #2: C Programming.....How many integers you want to ad...: C PROGRAMMING/Enter number integers to add #include <stdio.h> #include <stdlib.h> int main() {     int a,b,c,sum...

C Programming.....How many integers you want to add.....

C PROGRAMMING/Enter number integers to add




#include <stdio.h>
#include <stdlib.h>






int main()
{
    int a,b,c,sum;

   printf("ENTER number of integers you wanna add\n");
   scanf("%d",&a);


   printf("Enter numbers\n");
   scanf("%d",&b);
   int array2[b];

sum=0;
   for (c=0;c<a;c++){

       sum=sum+array2[b];
   }
   printf("Sum is %d\n", sum);

}/>