Advertisement
Dimitru

Codigo C

Jun 18th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.30 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<conio.h>
  3.  
  4. main(void)
  5. {
  6.     int s,a,n,i;
  7.         s=0;
  8.     printf("\nA=");
  9.     scanf("%d"&a);
  10.      
  11.      do {
  12.         printf("\nN= ");
  13.          scanf(n<=0);
  14.      }  while(n<=0);
  15.      
  16.      for (i=1;i<=n;i++)
  17.         {
  18.             s=s+a;
  19.             a=a+1;
  20.         }
  21.  
  22.     printf("\nSoma: %d", s);
  23.     getch();
  24.  
  25.  
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement