Главная / Программирование на языке C в Microsoft Visual Studio 2010 / В результате выполнения какой программы будет получен приведенный файл?[картинка]

В результате выполнения какой программы будет получен приведенный файл?files

вопрос

Правильный ответ:

#include <stdio.h> int main( void ) { FILE *stream; char list[30]; int i, numread, numwritten; if( (stream = fopen("g:\\fread.out", "w+t")) != NULL ) { for ( i = 0; i < 26; i++ ) list[i] = (char)('a' + i); numwritten = fwrite( list, sizeof( char ), 26, stream ); printf( "Wrote %d items\n", numwritten ); fclose( stream ); } else printf( "Problem opening the file\n" ); if( (stream = fopen("g:\\fread.out", "r+t" )) != NULL ) { numread = fread( list, sizeof( char ), 26, stream ); printf( "Number of items read = %d\n", numread ); printf( "Contents of buffer = %.26s\n", list ); fclose( stream ); } else printf( "File could not be opened\n" ); }
#include <stdio.h> int main( void ) { FILE *stream; char list[30]; int i, numread, numwritten; if( (stream = fopen("g:\\fread.out", "w+t")) != NULL ) { for ( i = 0; i < 26; i++ ) list[i] = (char)('z' - i); numwritten = fwrite( list, sizeof( char ), 26, stream ); printf( "Wrote %d items\n", numwritten ); fclose( stream ); } else printf( "Problem opening the file\n" ); if( (stream = fopen("g:\\fread.out", "r+t" )) != NULL ) { numread = fread( list, sizeof( char ), 26, stream ); printf( "Number of items read = %d\n", numread ); printf( "Contents of buffer = %.26s\n", list ); fclose( stream ); } else printf( "File could not be opened\n" ); }
#include <stdio.h> int main( void ) { FILE *stream; char list[30]; int i, numread, numwritten; if( (stream = fopen("g:\\fread.txt", "w+t")) != NULL ) { for ( i = 0; i < 26; i++ ) list[i] = (char)('z' - i); numwritten = fwrite( list, sizeof( char ), 26, stream ); printf( "Wrote %d items\n", numwritten ); fclose( stream ); } else printf( "Problem opening the file\n" ); if( (stream = fopen("g:\\fread.txt", "r+t" )) != NULL ) { numread = fread( list, sizeof( char ), 26, stream ); printf( "Number of items read = %d\n", numread ); printf( "Contents of buffer = %.26s\n", list ); fclose( stream ); } else printf( "File could not be opened\n" ); }
#include <stdio.h> int main( void ) { FILE *stream; char list[30]; int i, numread, numwritten; if( (stream = fopen("g:\\fread.txt", "w+t")) != NULL ) { for ( i = 0; i < 26; i++ ) list[i] = (char)('a' + i); numwritten = fwrite( list, sizeof( char ), 26, stream ); printf( "Wrote %d items\n", numwritten ); fclose( stream ); } else printf( "Problem opening the file\n" ); if( (stream = fopen("g:\\fread.txt", "r+t" )) != NULL ) { numread = fread( list, sizeof( char ), 26, stream ); printf( "Number of items read = %d\n", numread ); printf( "Contents of buffer = %.26s\n", list ); fclose( stream ); } else printf( "File could not be opened\n" ); }
Сложность вопроса
30
Сложность курса: Программирование на языке C в Microsoft Visual Studio 2010
62
Оценить вопрос
Очень сложно
Сложно
Средне
Легко
Очень легко
Комментарии:
Аноним
спасибо за пятёрку
27 июн 2020
Аноним
Я преподаватель! Прямо сейчас сотрите ответы на интуит. Не ломайте образование
12 май 2017
Оставить комментарий
Другие ответы на вопросы из темы программирование интуит.