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
Is it possible to initialize a variable at the time it was declared?
What is dangling pointer in c?
What does c mean in standard form?
which of the following is not a character constant a) 'thank you' b) 'enter values of p, n ,r' c) '23.56E-o3' d) all of the above
a parameter passed between a calling program and a called program a) variable b) constant c) argument d) all of the above
What is double pointer?
Function calling procedures? and their differences? Why should one go for Call by Reference?
Can you explain the four storage classes in C?
What are loops c?
What is malloc return c?
What is the difference between call by value and call by reference in c?
Write a C program on Centralized OLTP, Decentralized OLTP using locking mechanism, Semaphore using locking mechanism, Shared memory, message queues, channel of communication, sockets and a simple program on Saving bank application program using OLTP in IPC?
What is the benefit of using const for declaring constants?
If null and 0 are equivalent as null pointer constants, which should I use?
What are high level languages like C and FORTRAN also known as?