05-12-2014, 04:04 PM
#include <cstdlib>
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
cout "Please enter the option <e, E or o, O>:";
char option=0;
cin >> option;
switch(option)
{
case 'e':
case 'E':
cout"\n";
cout "Even number 1 to 50" endl "\n";
for(int i=1; i<=50; i++)
{
if(i%2==0)
{
cout i ",";
}
}
break;
case 'o':
case 'O':
cout"\n";
cout "Odd Number 1 to 50" endl "\n";
for(int i=1; i<=50; i++ )
{
if(i%2==1)
{
cout i ", ";
}
}
break;
default:
cout"\n";
cout "your choice is Wrong please Enter [e,E,o,O]";
}
cout"\n";
coutendl;
system("PAUSE");
return EXIT_SUCCESS;
}
#include <cstdlib>
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
cout "Please enter the option <e, E or o, O>:";
char option=0;
cin >> option;
switch(option)
{
case 'e':
case 'E':
cout"\n";
cout "Even number 1 to 50" endl "\n";
for(int i=1; i<=50; i++)
{
if(i%2==0)
{
cout i ",";
}
}
break;
case 'o':
case 'O':
cout"\n";
cout "Odd Number 1 to 50" endl "\n";
for(int i=1; i<=50; i++ )
{
if(i%2==1)
{
cout i ", ";
}
}
break;
default:
cout"\n";
cout "your choice is Wrong please Enter [e,E,o,O]";
}
cout"\n";
coutendl;
system("PAUSE");
return EXIT_SUCCESS;
}
0300-9520262
Get solution in 24 hour |cpmputer & internet
mileys81:[SIZE="4"][SIZE="3"]....[/SIZE][/SIZE]
