Program to write some contents into a file using file
operations with proper error messages.
Answer Posted / manvitha
//writing into a file
main()
{
char c;
FILE *fp;
fp=fopen("infor.dat",'w');
printf("enter data \n enter tab & enter a stop\n");
do
{
c=getchar();
put c(c,fp);
}while(c!='\t');
fclose(fp);
getch();
}
Is This Answer Correct ? | 6 Yes | 2 No |
Post New Answer View All Answers
What are extern variables in c?
What are the disadvantages of a shell structure?
what are the facialities provided by you after the selection of the student.
Define VARIABLE?
How can you convert integers to binary or hexadecimal?
void main(){ int a; a=1; while(a-->=1) while(a-->=0); printf("%d",a); }
What is c programming structure?
What is an expression?
write a program to rearrange the array such way that all even elements should come first and next come odd
Why n++ execute faster than n+1 ?
Explain what does the format %10.2 mean when included in a printf statement?
What is switch in c?
Write a program for finding factorial of a number.
What does the file stdio.h contain?
Differentiate between calloc and malloc.