rambo189619

FUNCION getINT

Apr 23rd, 2012
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.24 KB | None | 0 0
  1. int getInt(){
  2.   char c;
  3.   int ok,num,resultado;    
  4.  
  5.   ok=scanf("%d",&num);
  6.   resultado=num;
  7.  
  8.   while (ok==0){
  9.     scanf("%c",&c);
  10.     ok=scanf("%d",&num);
  11.     resultado=num;
  12.   }
  13. return resultado;        //Devuelve el resultado
  14. }
Advertisement
Add Comment
Please, Sign In to add comment