The purpose of this exercise is to benchmark file writing
and reading speed. This exercise is divided into two parts.
a). Write a file character by character such that the total
file size becomes approximately >10K. After writing close
the file handler, open a new stream and read the file
character by character. Record both times. Execute this
exercise at least 4 times
b). Create a buffer capable of storing 100 characters. Now
after generating the characters, first store them in the
buffer. Once the buffer is filled up, store all the
elements in the file. Repeat the process until the total
file size becomes approximately >10K.While reading read a
while line, store it in buffer and once buffer gets filled
up, display the whole buffer. Repeat the exercise at least
4 times with different size of buffer (50, 100, 150 …).
Records the times.
c). Do an analysis of the differences in times and submit
it in class.



The purpose of this exercise is to benchmark file writing and reading speed. This exercise is divi..

Answer / Jyoti Awasthi

[This question requires code execution, but here's a brief description of the tasks]n
1. Write a file character by character to create a file larger than 10K.
2. Close the file handler and open a new stream to read the file character by character.
3. Record both times.
4. Repeat this exercise at least 4 times.
5. Create buffers capable of storing different amounts of characters (e.g., 50, 100, 150...).
6. After generating characters, store them in the buffer until it's filled up.
7. Once the buffer is full, store all the elements in the file.
8. Repeat the process until the total file size becomes approximately >10K.
9. While reading, read a while line and store it in the buffer.n10. Once the buffer gets filled up, display the whole buffer.n11. Analyze the differences in times and submit it in class.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Interview Questions

If 4 digits number is input through the keyboard, Write a program to calculate sum of its 1st & 4th digit.

12 Answers   Google,


what is the use of call back function in c?tell me with example

2 Answers   Bosch,


write a program to arrange the contents of a 1D array in ascending order

4 Answers  


Is there any possibility to create customized header file with c programming language?

1 Answers  


what will be the output of this program........ main() { int a=2,b=4,c=6; printf("%d"); } why it gives the value of third variable.

6 Answers   HCL,


write an interactive program to generate the divisors of a given integer.

7 Answers   TCS,


What is the difference between fread buffer() and fwrite buffer()?

1 Answers  


AMMONG THE 4 STROAGE CLASSES IN C, WHICH ONE FASTEST?

13 Answers   HCL,


What are the different types of C instructions?

1 Answers   InterGraph,


What is an arrays?

1 Answers  


Differentiate between declaring a variable and defining a variable?

1 Answers  


void swap(int a,int b) { a=a+b; b=a-b; a=a-b; } in this code always gives the same result for all case

9 Answers   Accenture, TCS,


Categories