Answer:
Option B(Body) is the correct answer for the above question.
Explanation:
The function is a defined processor of some specific task, which is used to perform some action of the task. The function is of two types one is predefined, which is defined by the compiler and, the other is user-defined, which is defined by the programmer. Any user-defined function has three parts--
- Function prototype: It states the type of function.
- Function body: It holds the collection of instruction that needs to perform by the function.
- Function call: From where the function is called.
The above question asked about the term, which holds the statement of the function and that term is function Body, which is defined above. So the answer body, which is stated from the option 'B'. Hence 'B', is the correct option while the other is not because--
- Option 'A' states about the header, which is not the part of the function
- Option 'C' states about data type, which defines the types of data.
- Option 'D' states none of these, but the answer is option B.
- Option 'E' states about the definition, which is not the correct answer.
Answer:
See explaination
Explanation:
#include <stdio.h>
#include <stdlib.h>
int main()
{
FILE * file_object;
char file_name[100];
char ch;
int characters=0, words=0;
printf("Enter source file name: ");
scanf("%s", file_name); //asking user to enter the file name
file_object = fopen(file_name, "r"); //open file in read mode
if (file_object == NULL)
{
printf("\nUnable to open file.file not exist\n"); //check if the file is present or not
}
while ((ch = fgetc(file_object)) != EOF) //read each character till the end of the file
{
if (ch == ' ' || ch == '\t' || ch == '\n' || ch == '\0') //if character is space or tab or new line or null character increment word count
words++;
else
characters++; //else increment character count this assures that there is no spaces count
}
printf("The file story.txt has the following Statistics:\n"); //finally print the final statistics
if (characters > 0)
{
printf("Words: %d\n", words+1); //for last word purpose just increment the count of words
printf("Characters (no spaces): %d\n", characters);
}
fclose(file_object); //close the file object
return 0;
}
The GCSE Computing MOOC (created with Cambridge University Press and Raspberry Pi) can be used either as a course or a flexible teaching resource,
Classes called child classes or subclasses inherit methods and variables