What's new
  • Welcome to PHCorner forums. Take a moment to sign up and gain unlimited access and extra privileges that guests are not entitled to, such as: All that and more! Registration is quick, simple and absolutely free. Join our community today!

Programming.. patulong! visual studio c++ 2010 express

Status
Not open for further replies.

keith18

Enthusiast
Joined
Nov 19, 2012
Posts
126
Reaction
19
Age
28
hulala.. ito na naman po ako.. whaha.. hirap ng bago, di alam kung san dapat ipost ang topic ko.. pagpasensyahan nyo na po ha.. thanks, patulong po sana ako sa programming, ito yung code code ko:
#include <iostream>
#include <string>
using namespace std;
using std::cout;
using std::cin;


int main()
{
int n;
char c;
string input,q1,q2,q3,q4,q5;
for (n=0;n<5;n++);
cout<<"Type an input [0 or 1]";
cin>> input;
if (input=="0"){
q1=input;
cout<<endl<<"Type an input [0 or 1]";
cin>> input;
if (input=="0"){
q2=q1 + input;
cout<<endl<<"Type an input [0 or 1]";
cin>> input;
if (input =="0"){
q5=q2 + input;
cout<<endl<<"Input String:"<<q5<<endl;
}
}

else{
q5=q1 + input;
cout<<endl<<"Input String;"<<q5<<endl;
}
}
else{
q3=input;
cout<<endl<<"Type an input [0 or 1]";
cin>> input;
if (input=="0"){
q4=q3 + input;
cout<<endl<<"Type an input [0 or 1]";
cin>> input;
if (input=="0"){
q5=q4 + input;
cout<<endl<<"Input String:" <<q5<<endl;
}
}
else{
q1=q3 + input;
cout<<endl<<"Type an input [0 or 1]";
cin>> input;
if (input=="0"){
q2=q1 + input;
cout<<endl<<"Type an input [0 or 1]";
cin>> input;
if (input=="0"){
q5=q2 + input;
cout<<endl<<"Input String:" <<q5<<endl;
}
}
else{
q5=q1 + input;
cout<<endl<<"Input String;"<<q5<<endl;
}
}
}
//code para malaman kung valid or invalid
if (q5=="000" ||q5=="1100" ||q5=="111" ||q5=="100" ||q5=="01"){
cout<<endl<<"VALID"<<endl;
}
else{
cout<<endl<<"INVALID"<<endl;
}
//para tumigil sandali
cout<<endl<<"Type any character then press enter key to continue";
cin>>c;
return 0;
}

ano yung code para kapag ngtype ako ng any character and hit enter e magcocontinue? tong akin kase, once i type any character and press enter, nawawala na, bumabalik na sa coding ulit, haha.. patulong,
 

rinozel

Enthusiast
hahaha,tama,loop gamitin mo,hanggang kelan ang counting?input po ba ang ika-count nya?matagal na ako hindi nakapagprogram more than 8yearz na pala,nakalimutan ko na ibang function,bigay mu nga yung problem at try ko gawa ng flow charting kung alam ko pa,haha
 
Comment

keith18

Enthusiast
okay na yang code boss, walang error,. ang gusto lang mangyari, kapag knilick ko yung enter, magcocontinue ulit sya sa paghingi ng input, May nakalgay jan na Press any character and enter to continue..
 
Comment

rinozel

Enthusiast
nakalimutan ko na mga ibang function,pwede mu yan gamitan din ng do while,
ipaloob mu lang yang ginawa mu sa do while,magdeclare ka ng char ulit.
 
Comment

rinozel

Enthusiast
nakalimutan ko na mga ibang function,pwede mu yan gamitan din ng do while,
ipaloob mu lang yang ginawa mu sa do while,magdeclare ka ng char ulit.
 
Comment
Status
Not open for further replies.

Popular On This Forum

Online statistics

Members online
1,676
Guests online
1,293
Total visitors
2,969

Forum statistics

Threads
1,131,832
Posts
18,723,554
Members
1,547,174
Comments
1,390,193
Attachments
1,499,635
Profile posts
98,742
Top