Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <ctype.h>
- #include <stdlib.h>
- #define TRUE 1
- #define FALSE 0
- void FinDatos(int* continua)
- {
- char respuesta;
- do {
- if(respuesta != 10)
- printf("¿Desea ingresar datos? s: Si n:No: ");
- respuesta=fgetc(stdin);
- } while ((tolower(respuesta) !='s') && (tolower(respuesta) !='n'));
- *continua=0;
- if (tolower(respuesta) =='s')
- *continua=1;
- }
- int main()
- {
- int sigue;
- FinDatos(&sigue); //Pregunto si desea ingresar el primer par de datos.
- if (sigue) //Si ingresó los primeros datos proceso.
- {
- printf("dentro del if de main\n");
- while (sigue)
- {
- printf("Ingrese un par de numeros enteros: \n");
- FinDatos(&sigue);
- }
- }
- else
- printf("No se ingresaron datos\n");
- return EXIT_SUCCESS;
- }
Add Comment
Please, Sign In to add comment