You are writing a new program. What information should be contained in a comment block at the top of that program? Pretend that you are explaining this concept to a new student that has never programmed before.
In the comment block the aim of the program should be stated.what is the purpose of the program should be mentioned clearly.
Example:
// the aim of the program is to add two numers And place the result in the third number
#include<stdio.h>
int main()
{
int a, b, c;
printf("Enter two numbers to add\n");
scanf("%d%d", &a, &b);
c = a + b;
printf("Sum of the numbers = %d\n", c);
return 0;
}
For this instance it is a small problem .there were large program having 1000 ' s of lines of code .for those program comments are very useful to understand the logic going on in the code
Get Answers For Free
Most questions answered within 1 hours.