Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. //--------------------------------------
  2. // Programmed by Eric Paez-Parent for CIS 1500
  3. //--------------------------------------
  4. #include <stdio.h>
  5.  
  6. // Define constants
  7.  
  8. //--------------------------------------
  9. int main(void) {
  10.  
  11. // Declare variables
  12.  
  13. char first_I, second_I;
  14. int age_Y;
  15. float N_credits;
  16.  
  17. // Input
  18.  
  19. printf("Enter first initial:");
  20. scanf("%c", &first_I);
  21.  
  22. printf("Enter second initial:");
  23. scanf("%c", &second_I);
  24.  
  25. printf("Enter age:");
  26. scanf("%d", &age_Y);
  27.  
  28. printf("Enter number of credits to graduate:");
  29. scanf("%f", &N_credits);
  30.  
  31. //Output
  32.  
  33. printf("Hi %c. %c. You are %d years old and still need %.1f credits to graduate.\n", first_I, second_I, age_Y, N_credits);
  34.  
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement