Шукаєте відповіді та рішення тестів для Coding Café ? Перегляньте нашу велику колекцію перевірених відповідей для Coding Café в dle.plaksha.edu.in.
Отримайте миттєвий доступ до точних відповідей та детальних пояснень для питань вашого курсу. Наша платформа, створена спільнотою, допомагає студентам досягати успіху!
From the previous lab exercise, extract the code to check if a given number is prime or not and organise it into a function called isPrime().
FILE *fp1 = fopen("states.txt", "r");while ((ch = fgetc(fp1)) != EOF) putchar(ch);fclose(fp1);
Write the equivalent Unix command for the above code.
fopen() can be used to read from or write into a file stream.
The file contains ten integers across seven lines. The task is to find out the average of these ten integers and copy the integers as well as the average into another file called
Additional exercises:
Pick only those odd numbers from the ten
numbers of the file and write these odd numbers, as well as their average into an
output file.
Next, modify the original program so that
instead of assuming the number of integers to be read from the file, the
program reads till all the integers of the file are read.
Write a program to implement the cp command of Unix.
Which of the following statements about arrays in C is correct?