Professional Documents
Culture Documents
Funcom
Funcom
Funcom
#include <conio.h>
int main ()
{
float c,k;
float i,s,a,x,y,z,w,r,e,n;
int q;
q=0;
while (q!=5)
{
++q;
c = (i+s+a+x+y+z+w+r+e+n)/1000;
k = c*100;
if(k>100)
{
cout <<"\n\nINVALID";
}
else if (k<0)
{
cout <<"\n\nINVALID";
}
else if (k==100)
{
cout << "\n\nOUTSTANDING";
}
else if (k<100&&k>75)
{
cout <<"\n\nPASSED";
}
if (k<75&&k>=50)
{
cout << "\n\nCONDITIONAL";
}
if (k<50)
{
cout <<"\n\nFAILED";
}
}
getche ();
}
#include <iostream>
#include <conio.h>
int main ()
{
float c,k;
float i,s,a,x,y,z,w,r,e,n;
for (int q=1; q<=5; q++)
{
cout<< "\n\nEnter Score 1:";
cin>> i;
c = (i+s+a+x+y+z+w+r+e+n)/1000;
k = c*100;
if(k>100)
{
cout <<"\n\nINVALID";
}
else if (k<0)
{
cout <<"\n\nINVALID";
}
else if (k==100)
{
cout << "\n\nOUTSTANDING";
}
else if (k<100&&k>=75)
{
cout <<"\n\nPASSED";
}
if (k<75&&k>=50)
{
cout << "\n\nCONDITIONAL";
}
if (k<50)
{
cout <<"\n\nFAILED";
}
getche ();
clrscr ();
}
getche ();
}
int main ()
{
float c,k;
float i,s,a,x,y,z,w,r,e,n;
int q;
q=0;
do
{
++q;
c = (i+s+a+x+y+z+w+r+e+n)/1000;
k = c*100;
if(k>100)
{
cout <<"\n\nINVALID";
}
else if (k<0)
{
cout <<"\n\nINVALID";
}
else if (k==100)
{
cout << "\n\nOUTSTANDING";
}
else if (k<100&&k>=75)
{
cout <<"\n\nPASSED";
}
if (k<75&&k>=50)
{
cout << "\n\nCONDITIONAL";
}
if (k<50)
{
cout <<"\n\nFAILED";
}
getche ();
clrscr ();
}
while (q!=5);
getche ();
}
The do while loop program
#include <iostream>
#include <conio.h>
int main ()
{
int score;
cout << "Enter score: ";
cin >> score;
if (score>100)
{
cout << "HIGH";
}
else
cout << "LOW";
getche ();
}
Sample program
#include <iostream>
#include <conio.h>
int main ()
{
int x;
cout << "How many greetings do you want? ";
cin >> x;
do
{
cout << "Hello\t";
x--;
}
while (x>0);
cout << "\n That's all!";
getche ();
}
int main ()
{
int q;
q=0;
while (q!=9500)
{
++q;
gotoxy (31,12);
cout << "Welcome FUNCOM 123";
}
clrscr ();
gotoxy (78,40);
cout << "0%";
}
clrscr ();
gotoxy (1,40);
cout << "[][][][][] 5%";
}
clrscr ();
gotoxy (1,40);
cout << "[][][][][][][][][][][] 20%";
}
clrscr ();
gotoxy (1,40);
cout << "[][][][][][][][][][][][][][][][][][][] 50%";
}
clrscr ();
gotoxy (1,40);
cout << "[][][][][][][][][][][][][][][][][][][][][][][][] 78%";
}
clrscr ();
gotoxy (1,40);
cout << "[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][] 92%";
}
clrscr ();
for (int t=0; t<=9900; ++t)
{
gotoxy (1,40);
cout << "[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]100%";
}
clrscr ();
gotoxy(1,8);
cout<<"\n\t\t xxxxxx xxxxxx";
cout<<"\n\t\t xx xx xx xx";
cout<<"\n\t\t xxx xxx xxx xxx";
cout<<"\n\t\t ";
cout<<"\n\t\t ";
cout<<"\n\t\t xxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
cout<<"\n\t\t xx xx";
cout<<"\n\t\t xx xx";
cout<<"\n\t\t x x";
cout<<"\n\t\t xxxxx xxxxx";
cout<<"\n\t\t xxxxxxxxxxx";
getche ();
}