program to find how many numbers of students pass from a first class, second class or fail
This Code is shared by Akshay Durge
Sample Output:
Code:
This Code is shared by Akshay Durge
Sample Output:
Code:
/*program to find how many numbers of students pass from a first class, second class or fail.*/
#include<iostream.h>
#include<conio.h>
int main()
{
clrscr();
int nos;
void per(int); //prototype'void'
cout<<"How many Students?"<<endl;
cin>>nos;
per(nos); //calling the function.
getch();
return(0);
}
void per(int nos) //function per with argument having 1 variable.
{
for(int i=1;i<=nos;i++)
{
int per;
cout<<"Enter percentage"<<endl;
cin>>per;
if(per>=75)
{
cout<<"Distinction"<<endl;
}
else
if(per>=60)
{
cout<<"First Class"<<endl;
}
else
if(per>=40)
{
cout<<"Second Class"<<endl;
}
else
if(per>=35)
{
cout<<"Pass"<<endl;
}
else
cout<<"Fail"<<endl;
}
}
Comment Bellow for your Query and Feedback... :)#include<iostream.h>
#include<conio.h>
int main()
{
clrscr();
int nos;
void per(int); //prototype'void'
cout<<"How many Students?"<<endl;
cin>>nos;
per(nos); //calling the function.
getch();
return(0);
}
void per(int nos) //function per with argument having 1 variable.
{
for(int i=1;i<=nos;i++)
{
int per;
cout<<"Enter percentage"<<endl;
cin>>per;
if(per>=75)
{
cout<<"Distinction"<<endl;
}
else
if(per>=60)
{
cout<<"First Class"<<endl;
}
else
if(per>=40)
{
cout<<"Second Class"<<endl;
}
else
if(per>=35)
{
cout<<"Pass"<<endl;
}
else
cout<<"Fail"<<endl;
}
}
0 comments:
Confused? Feel free to ask
Post a Comment