answersLogoWhite

0

#include<stdio.h>

#include<stdlib.h>

int main()

{

FILE *fp;

char a[60],b[60];

printf("Enter the name of the file\n");

scanf("%s",a);

fp=fopen(a,"a+");

printf("Enter a single line to append to the file %s :\n",a);

scanf(" %[^\n]s",b);

fprintf(fp,"%s",b);

printf("Append Successfully to the file %s",a);

fclose(fp);

return 0;

}

User Avatar

Wiki User

12y ago

What else can I help you with?

Continue Learning about Engineering

What is the difference between read and write in computer programming?

A "Read" operation occurs when a computer program reads information from a computer file/table (e.g. to be displayed on a screen). The "read" operation gets information out of a file (some computer languages use the term "get" instead of "read"). After a "read", the information from the file/table is available to the computer program but none of the information that was read from the file/table is changed in any way. A "Write" operation occurs when a computer program adds new information, or changes existing information in a computer file/table. An example of a computer program adding new information to a file would be when a company adds a new hire's details into its employee master file. An example of a computer program changing existing information would be when a company updates its employee master file if an existing employee changes their address. In this example, since the employee already existed in the employee file, the computer program would have had to perform a "read" at some point, to get the information out of the file/table (a fundamental rule of computer programming is that you can't update a record in a file/table unless you perform a "read" operation to get a hold of that record in the first place). Either way, the "Write" operation is what puts information in to a file. Some computer languages use the terms "put" or "update", but these are both "write" operations in general IT terms. Bottom line: Read = get information. Write = add or change information. HTH


Why do some programmers prefer to write a program from scratch rather than modify a program written by someone else?

Professional programmers would never write code from scratch if they could avoid it, but there may be legal reasons why an existing program cannot be modified. Amateur programmers and hobbyists. however, will often write programs from scratch purely to exercise their problem-solving abilities.


How can you read and write to files in C programming language?

We can read and write to files with the help of file commands in c programming.There are so many commands related to file for read,write,append,delete etc.


How to write program for secant method in mathematica?

How to write a program for secant method by mathematica


Write a program in Lex to eliminate white space and collect numbers as a token?

write a lex program to delete space from the program

Related Questions

What is difference between append mode and write mode?

Write mode over writes the existing file and if not present creates a new one. Append mode never over writes the existing file. Append mode opens the file and sets the file cursor to the end of the file so that any write operation can start from the very ending of that file. Hope I helped :)


How you can delete the data in the file by opening it in the C programming in read or write mode?

To delete all the existing data in a file, simply open it in write mode. If you open the file in append mode, you need to overwrite the existing data to delete part or all of that data.


What abilities does the NTFS write permission grant?

Write to the file, append to the file, and read or change its attributes.


How do you write 2220 million?

2,220,000,000. A million requires you to append 6 zeros.


Write a program for merging two linked lists?

If you mean merging two sorted list, that would be like this: to= empty WHILE NOT empty(a) OR NOT empty(b) DO IF empty(b) OR first(a)&lt;first(b) THEN append(to, first(a)) a:= next(a) ELSE IF empty (a) OR first(a)&gt;first(b) THEN append(to, first(b)) b:= next(b) ELSE IF first(a)=first(b) THEN append(to, first(a)) append(to, first(b)) # if you want duplicates in the output a:= next(a) b:= next(b) END IF END WHILE


Write a c program to perform stack operation?

int top=-1; int stack[10];


What is the memory write operation?

read/write permissions/privileges allow the user to read, append and delete records from your database tables, however it cannot alter / create / drop the tables and its structures.Read/write privileges are ideal for forums and production websites that don't require creation or alteration of table structures on its normal operations.


What is the difference between read and write in computer programming?

A "Read" operation occurs when a computer program reads information from a computer file/table (e.g. to be displayed on a screen). The "read" operation gets information out of a file (some computer languages use the term "get" instead of "read"). After a "read", the information from the file/table is available to the computer program but none of the information that was read from the file/table is changed in any way. A "Write" operation occurs when a computer program adds new information, or changes existing information in a computer file/table. An example of a computer program adding new information to a file would be when a company adds a new hire's details into its employee master file. An example of a computer program changing existing information would be when a company updates its employee master file if an existing employee changes their address. In this example, since the employee already existed in the employee file, the computer program would have had to perform a "read" at some point, to get the information out of the file/table (a fundamental rule of computer programming is that you can't update a record in a file/table unless you perform a "read" operation to get a hold of that record in the first place). Either way, the "Write" operation is what puts information in to a file. Some computer languages use the terms "put" or "update", but these are both "write" operations in general IT terms. Bottom line: Read = get information. Write = add or change information. HTH


Why do some programmers prefer to write a program from scratch rather than modify a program written by someone else?

Professional programmers would never write code from scratch if they could avoid it, but there may be legal reasons why an existing program cannot be modified. Amateur programmers and hobbyists. however, will often write programs from scratch purely to exercise their problem-solving abilities.


How can you read and write to files in C programming language?

We can read and write to files with the help of file commands in c programming.There are so many commands related to file for read,write,append,delete etc.


How do you write a program to performs all airthematic operation between two matrixs using array?

To write a program that performs arithmetic operations between two matrices using arrays, first define two 2D arrays to represent the matrices. Then, create functions for each arithmetic operation (addition, subtraction, multiplication, etc.) that iterate through the elements of the matrices, performing the operation element-wise. Ensure to handle cases where the matrices have different dimensions, as this would affect the validity of the operations. Finally, print the result matrix after each operation.


What is the difference between reading and writing in relation to a computer storage medium?

When undertaking a write operation the read/write head usually has to use more power during a write operation as this operation must effect a change of state in the storage medium. On the read operation the read/write head merely has to detect this changed state.