User Profile
Collapse
-
sorry my bad.. my question is the output process after the conditional operator... when will the "#" part be display: at L is even or odd? -
how does the following code work {(L%2!=0)?(cout<<ARR[L])<<
...Code:#include<iostream> using namespace std; void ChangeArray (int Number, int ARR[], int Size) { for (int L=0; L<Size; L++) if(L<Number) ARR[L]= L + ARR[L]; else ARR[L]= L*ARR[L]; }; void Show(int ARR[], int Size) { for (int L = 0; L<Size; L++) {(L%2!=0)?(cout<<ARR[L])<<"#" : (cout<<ARR[L])<<endl; -
do while loops do not repeat correctly
Sir,
Sorry for the big trouble i made, when the program repeat
cout<<"\nEnter name: ";
this statement appear but the next statement
gets(name);
do not work...
so far i read in the internet... i knew i have to used the flush... i would be glad if you tell me how to use the flush thank youLeave a comment:
-
Sir, thank you for your answer, but the program still end after i press y... see this image..
http://bytes.com/attachments/attachm...46/dowhile.jpg...Leave a comment:
-
my do while loop never repeat... plese help!!
#include<iostre am>
#include<string >
using namespace std;
class Project
{
char ch, name[30], add[30], subj[15];
int age;
float msal,gross, lfee[11], annual, total[11];
public:
void enter();
void disp();
};
void Project::enter( )
{
do
{
cout<<"\nEnter name:... -
expected `;' before '{' token and expected `}' at end of input
#include<iostre am>
#include<string >
using namespace std;
class Project
{
public:
char name[21], add[15];
float emp[4], sal[11], total[11];
void enter();
void disp();
};
int main( )
{
Project data;
data.enter()
{
for(int i=0; i<5; i++)
{
cout<<"\nFor...
No activity results to display
Show More
Leave a comment: