Advertisement
AdVitiya

Untitled

Feb 27th, 2025
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.67 KB | Source Code | 0 0
  1. //user input:-
  2. # include <stdio.h>
  3.  
  4. int main()
  5. {
  6.  
  7.     char name[25];
  8.     printf("What is your name?: ");
  9.     scanf("%s", name);
  10.  
  11.     int age;
  12.     printf("What is your age?: ");
  13.     scanf("%d", &age);
  14.    
  15.     char grade;
  16.     printf("What grade did you get?: ");
  17.     scanf(" %c", &grade);
  18.  
  19.     printf("Your name is %s, aged %d and got a grade of %c", name, age, grade);
  20.     // printf("my name is %s\n", name);
  21.     // printf("i got %c grade\n", grade);
  22.     // printf("you are %d years old\n",age);
  23.  
  24.     // char full_name[25];
  25.  
  26.     // printf("what is your full name?");
  27.     // fgets(full_name,25,stdin);
  28.  
  29.     // printf("my name is %s",full_name);
  30.     return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement