একটি পরীক্ষায় কত পার্সেন্ট ছাত্র/ছাত্রী পাশ এবং ফেল করেছে তা বের করার জন্য একটি প্রোগ্রাম লিখ।
Program:
#include<stdio.h>
main()
{
int n,m,p,i,f=0,pass;
float mark;
printf("Enter students : N= ");
scanf("%d", &n);
printf("Enter pass marks : M= ");
scanf("%d", &m);
for(i=1; i<=n; i++)
{
printf("Enter mark for [id %d] = ",i);
scanf("%f", &mark);
if(mark>m)
f++;
}
p=(f*100)/n;
printf("Percentage of students fail to pass the exam = %d", p);
pass=100-p;
printf("\nPercentage of students pass to pass the exam = %d", pass);
}
Program:
#include<stdio.h>
main()
{
int n,m,p,i,f=0,pass;
float mark;
printf("Enter students : N= ");
scanf("%d", &n);
printf("Enter pass marks : M= ");
scanf("%d", &m);
for(i=1; i<=n; i++)
{
printf("Enter mark for [id %d] = ",i);
scanf("%f", &mark);
if(mark>m)
f++;
}
p=(f*100)/n;
printf("Percentage of students fail to pass the exam = %d", p);
pass=100-p;
printf("\nPercentage of students pass to pass the exam = %d", pass);
}