Assume the content of the file test.txt is "Hello" and answer the following question: #include<stdio.h> void main() { File*fp; fp= fopen("test.txt",'r'); char c =fgetc(fp); printf("%d", ftell(fp)); }
Added by Gabriel O.
Close
Step 1
The code includes the header file stdio.h, which provides functions for input and output operations. Show more…
Show all steps
Your feedback will help us improve your experience
Madhur L and 56 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
Write a C++ program that reads a file consisting of students’ test scores in the range 0–200. It should then determine the number of students having scores in each of the following ranges: 0–24, 25–49, 50–74, 75–99, 100–124, 125–149, 150–174, and 175–200. Output the score ranges and the number of students. (Run your program with the following input data: 76, 89, 150, 135, 200, 76, 12, 100, 150, 28, 178, 189, 167, 200, 175, 150, 87, 99, 129, 149, 176, 200, 87, 35, 157, 189
Supreeta N.
Write a program that will read data from the file "p6.dat". The file (that you will create) always contains 15 test scores (whole numbers between 0 and 100). The test scores are scores for 5 students taking 3 tests, and are arranged in the file by the student - that is, the first 3 numbers are the test scores for test 1, 2, and 3 for the first student, etc. The program will print: - Average per student (5 averages), on a single line, with 2 decimals - Average per test (3 averages), on a single line, with 2 decimals - Overall best score on a single line - How many scores were Fs (out of the 15, how many were at most 59) on a single line To simplify the code, no validations are needed. That is, assume the file is successfully opened, and that all data are 0-100, and that there are exactly 15 numbers in the file. Note that the program reads the filename.
Oswaldo J.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Transcript
Watch the video solution with this free unlock.
EMAIL
PASSWORD