Intermediate Part II Problem: To calculate how many students are pass and fail out of 15 ( Student will pass if he secure 60% marks or above). #include <stdio.h> #include
void main() { clrscr(); int marks,pass=0,fail=0; for (int i=1;i<=15;i++) { printf("\n Enter The Marks of Student %d : ",i); scanf("%d",&marks); if (marks>=60) pass=pass+1; else fail=fail+1; } printf("\n\n---------------------------------------------------------"); printf("\n\nThe Number of Passed Students: %d",pass); printf("\n\nThe Number of Failed Students: %d",fail); printf("\n\n---------------------------------------------------------"); getch(); }
Click the link below to see more examples http://ravianeducation.blogspot.com E-Mail: [email protected]