fork download
  1. #include <stdio.h>
  2.  
  3. int main(){
  4. char str1[30];
  5. int num;
  6.  
  7. printf("Enter Name: \n");
  8. scanf("%s", str1);
  9.  
  10. printf("Enter Age: \n");
  11. scanf("%d", &num);
  12.  
  13. if (num<=20) {
  14. printf("%s/n", "You are a youngster. \n");
  15. }
  16. else if (num>20 && num<61) {
  17. printf("%s\n %c %d", "You are an adult \n", str1, &num);
  18. }
  19. else if (num>60) {
  20. printf("%s %c %d", "You are getting on in years \n", str1, &num);
  21. }
  22. return 0;
  23. }
  24.  
Success #stdin #stdout 0s 9432KB
stdin
a;lsdkfj
stdout
Enter Name: 
Enter Age: 
You are getting on in years 
 p 993675372