A
Q. What is the output of the following C program?
#include <stdio.h> int main() { char c; int i = 0; FILE *file; // write to the text file file = fopen("test.txt", "w+"); fprintf(file, "%c", 'x'); fprintf(file, "%c", -1); fprintf(file, "%c", 'y'); fclose(file); // read from the text file file = fopen("test.txt", "r"); while ((c = fgetc(file)) != -1) printf("%c", c); return 0; }
The output is as follows: $gcc prog3.c $ a.out x
You must be Logged in to update hint/solution
Be the first to start discuss.
Q. Which function converts a string of digits into its numeric equivalent
Q. Which of the following is not a valid variable name declaration?
Q. what is the initial value of register storage class specifier?
Q. The sqrt() function is used to calculate which value?
Q. The information about an array used in program will be stored in
Q. Libray function getch() belongs to which header file?
Q. The size of a union is ___.
Q. What will be the output of the following C code?
Q. The C library function double fmod(double x, double y) returns the remainder of x divided by y.
Discusssion
Login to discuss.