#include<stdio.h>
      int main()
      {
          printf("\n\n\t\tStudytonight - Best place to learn\n\n\n");
          int n,sum=0,c,value;
          printf("\n\nEnter the number of integers you want to add:  ");
          scanf("%d", &n);
          printf("Enter %d integers\n\n",n);
          for(c = 1; c <= n; c++)
          {
              scanf("%d", &value);
              /* 
                  need to initialise sum before using otherwise 
                  garbage value will get printed
              */
              sum += value;
          }
          printf("\n\n\nsum of entered numbers  = %d", sum);
          printf("\n\n\t\t\tCoding is Fun !\n\n\n");
          return 0;
      }
      
      C language logo

      Number in C

      0

      0

      avatar
      natalie19970

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.