______ is used in C to write a single character to a file. 

A

fputs() 

B

fprintf()

C

fputc() 

D

fwrite()


উত্তরের বিবরণ

img

 Answer: ) fputc()

 Explanation:
In C programming, different functions are used for file I/O:

fputc(int c, FILE *fp)→→Writes a single character c to the file pointed by fp.

fputs(const char *str, FILE *fp)→→Writes a string (multiple characters) to the file.

fprintf(FILE *fp, const char *format, ...)→→Writes formatted data to the file.

fwrite(const void *ptr, size_t size, size_t nmemb, FILE *fp)→→Writes binary data to the file (multiple bytes).
 
Example:

 FILE *fp = fopen("file.txt", "w");
fputc('A', fp); // writes character 'A' to the file
fclose(fp);

 

Unfavorite

0

Updated: 2 days ago

Related MCQ

Which of the following is a guided transmission medium?

Created: 4 days ago

A

Radiowave

B

Microwave

C


Coaxial Cable 

D

Infrared

Unfavorite

0

Updated: 4 days ago

 In machine learning, supervised learning means: 

Created: 2 days ago

A

Training with unlabeled data

B

No training is required

C

Training with labeled data

D

Only reinforcement signals are used

Unfavorite

0

Updated: 2 days ago

Which one below is an example of a NoSQL database?

Created: 2 days ago

A

MySQL

B

MongoDB

C

Oracle


D

PostgreSQL

© LXMCQ, Inc. - All Rights Reserved

Developed by WiztecBD