I am confused that how to give break line after every word which is present in a file.
Words in text file
Name Date of birth <---- I put this in code
John 02\02\1999 <---- I want to jump to this line
I want this
Here is your: Name
Here is your: Date of Birth
But it is giving me this
Here is your: N
Here is your: a
Here is your: m
Here is your: e
And I don't know how to get it.
#include <stdio.h>
#include <stdlib.h>
int main(){
FILE * fr = fopen("/home/bilal/Documents/file.txt","r");
char ch;
if(fr != NULL){
while(!feof(fr)){
ch = fgetc(fr);
printf("Here is your %c\n: ", ch);
}
fclose(fr);
}
else{
printf("Unable to read file.");
}
return 0;
}