Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

help!:about Borland C++ 5.5.1 for win32 , EditPlus&Ultra

Status
Not open for further replies.

laurence

Newbie level 1
Joined
Mar 25, 2005
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,295
about Borland C++ 5.5.1 for win32 command line tool, EditPlus&UltraEdit

just downloaded a Borland C++ 5.5.1 for win32 command line tool,with EditPlus &UltraEdit to learn algorithm,written a program in C to find the digits of every input x-based number.

#include <stdio.h>
int digits(int n,int base);
int main(){
int myNumber,myBase;
scanf(\"Please input the number= %d\",&myNumber);
scanf(\"Please input the base= %d\",&myBase);
digits(myNumber,myBase);
}
int digits(int n,int base){
if(n<base) return n;
else {
printf(\"the digits are(from the least significant)\\n%d\",n%base);
return digits(n/base,base);
}
}

when bss32.exe in editplus, no resopnse?Can anyone tell me what happened?
Changed to C++,everything is OK,what happended?
#include <iostream.h>
int digits(int n,int base);
int main(){
int myNumber,myBase;
cout<<\"Please input the number=\"<<endl;
cin>>myNumber;
cout<<\"Please input the base=\"<<endl;
cin>>myBase;
digits(myNumber,myBase);
}
int digits(int n,int base){
if(n<base) {
cout<<\"The Most significant digit is \"<<n<<endl;
return n;}
else {
cout<<\"the digits are(from the least significant)\"<<n%base<<endl;
return digits(n/base,base);
}
}


Besides,how to run the compiled file of .exe in editplus without changing the toolbar command's setting each time?

All the above programs in ultraEdit contain clauses like scanf,cin will have a problem, what to do?

many thanks!
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top