This is C language programming. Why does printf print together? They're not as separate as they were in the beginning. T
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
This is C language programming. Why does printf print together? They're not as separate as they were in the beginning. T
Why does printf print together?
They're not as separate as they were in the beginning.
Thank you for your help~~~~
8 9 #include <stdio.h> 10 11 int main() 12 { 13 char name[50]; 14 int number; 15 while(1){ 16 printf("Please enter your name: \n"); 17 scanf("%[^\n]", name); 18 printf("Please enter your number: \n"); 19 scanf("%d",&number); 20 printf("Your name is : %s\n", name); 21 printf("Your number is : %d\n", number); 22 23 return 0; 24 } 25 input Please enter your name: Alan Please enter your number: 911 Your name is : Alan Your number is : 911 Please enter your name: Please enter your number: