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


Please Help Members By Posting Answers For Below Questions

What are extern variables in c?

543


What are the disadvantages of a shell structure?

686


what are the facialities provided by you after the selection of the student.

1650


Define VARIABLE?

684


How can you convert integers to binary or hexadecimal?

612






void main(){ int a; a=1; while(a-->=1) while(a-->=0); printf("%d",a); }

1251


What is c programming structure?

614


What is an expression?

652


write a program to rearrange the array such way that all even elements should come first and next come odd

1756


Why n++ execute faster than n+1 ?

1838


Explain what does the format %10.2 mean when included in a printf statement?

771


What is switch in c?

642


Write a program for finding factorial of a number.

629


What does the file stdio.h contain?

597


Differentiate between calloc and malloc.

751