không hiểu sao khi mình nhập vào fgets()
là nguyen thanh long rồi sau đó khi xuất ra bằng printf()
thì nguyen thanh long
và số 23
không cùng nằm trên 1 dòng,thay vào đó,khi kết thúc printf("%s\t",c)
thì nó lại nhảy xuống dòng rồi mới in 23
ai biết nguyên nhân và cách khắc phục không ạ
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#include <string.h>
#include <ctype.h>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main(int argc, char** argv) {
char c[50];
fgets(c,sizeof(c),stdin);
printf("%s\t",c);
printf("%d\t",23);
return 0;
}