Programming MCQS - QUESTION DETAILS

How do you open a file for writing in C?
A. fopen("file.txt", "r");
B. open("file.txt", "w");
C. fopen("file.txt", "w");
D. open("file.txt", "r");

'fopen' with "w" opens a file for writing in C.

Similar Questions

What is the role of the 'strcpy' function in C?






What is the output of printf("%s", "Hello" + 1);?






What does the 'sizeof' operator return for a pointer variable?






What is the purpose of the 'strcat' function in C?






What is the purpose of the 'continue' statement in a loop?






How do you open a file for writing in C?






What is the role of the 'static' keyword in C?






Which of the following is a bitwise AND operator in C?






How do you declare a pointer in C?






How do you include a header file in C?