Paisen

while2

Sep 20th, 2020 (edited)
55
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.  
  3. int a,c=0;
  4. char opc;
  5.  
  6. int main (){
  7.    
  8. while(opc!='N'){
  9. printf("Introduzca numero cualquiera\n");
  10. scanf("%d",&a);
  11. c=c+a;
  12. fflush(stdin);
  13. printf("Desea introducir mas? S= si, N= no\n");
  14. scanf("%c",&opc);
  15. }
  16. printf("\nLa suma de estos numeros es de: %d\n",c);
  17.     return 0;
  18. }
Add Comment
Please, Sign In to add comment