Advertisement
Guest User

Untitled

a guest
Oct 16th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.37 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6.     float n1 = 0, n2 = 0;
  7.     char choice = 0;
  8.    
  9.     do {
  10.         n1 = 0;
  11.         n2 = 0;
  12.         choice = 0;
  13.        
  14.         printf( "Enter a character, and two floats.\n" );
  15.         int read = scanf( "%c %f %f", &choice, &n1, &n2 );
  16.         printf( "Values read: %d -- %c, %.2f, %.2f\n", read, choice, n1, n2 );
  17.     } while( choice != 'q' );
  18.    
  19.     return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement