Paisen

do_while2

Sep 20th, 2020
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.29 KB | None | 0 0
  1. #include<stdio.h>
  2.  
  3. int a,c=0;
  4. char opc;
  5.  
  6. int main (){
  7. do{
  8. printf("Introduzca numero cualquiera\n");
  9. scanf("%d",&a);
  10. c=c+a;
  11. fflush(stdin);
  12. printf("Desea introducir mas? S= si, N= no\n");
  13. scanf("%c",&opc);
  14. }while(opc!='N');
  15. printf("\nLa suma de estos numeros es de: %d",c);
  16.     return 0;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment