Explain the purpose of each segment marked (i) to (vi) of the following prograam. what this program will do ?
i) int i;
int mark [20];
ii) for (i=o; i<20; i++) {
iii) printf ("enter the number");
scanf("%d" , &mark [i];
iv) if (marks[i] < 40)printf(" Not Successful");
v) if (mark[i] >= 40) && (mark[i] < 60)) printf ("passed in second division);
vi) if (marks[i] >= 60 printf("passed in first division);
}
Answers
Answered by
11
this segment of program is make to decide whether the student is passed with first division,second division or failed.
in (i) 'i'variable is declared
in (ii) integer array is given with values by loop
in (iii) the input marks is checked whether it is less than 40 if true then it will print the unsuccessful
in (iv) if III is false then written condition is checked whether the marks is between 40 and 60 like true it will print second division
in (i) 'i'variable is declared
in (ii) integer array is given with values by loop
in (iii) the input marks is checked whether it is less than 40 if true then it will print the unsuccessful
in (iv) if III is false then written condition is checked whether the marks is between 40 and 60 like true it will print second division
Similar questions