Advertisement
Guest User

Untitled

a guest
Jan 29th, 2015
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3.  
  4. void first_func() {
  5. float num1, num2;
  6. printf("Enter two numbers\nFirst: "); scanf("%f", &num1);
  7. printf("Second: "); scanf("%f", &num2);
  8. if (num1 == num2)
  9. {
  10. printf("They are equal: %f = %f", num1, num2);
  11. }
  12. else if (num1 > num2)
  13. {
  14. printf("They are not equal, %f > %f", num1, num2);
  15. }
  16. else
  17. {
  18. printf("They are not equal, %f < %f", num1, num2);
  19. }
  20. }
  21.  
  22. int main(void)
  23. {
  24. int age;
  25. first_func();
  26.  
  27. printf("\n\nEnter your age: "); scanf("%d", &age);
  28. if (age < 18)
  29. {
  30. printf("Please leave this place! You're too young.");
  31. }
  32. else if ((age >= 18) && (age < 60))
  33. {
  34. printf("Enjoy the site!");
  35. }
  36. else
  37. {
  38. printf("You're much too old!");
  39. }
  40.  
  41. getch();
  42. return 0;
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement