What does this code snippet do?
long sin=234567890;
while (sin > 0) {
cout << sin % 10 << endl;
sin /= sin;
}




Posted 10 February 2011 - 11:30 PM
Posted 10 February 2011 - 11:43 PM
Posted 10 February 2011 - 11:54 PM
Posted 10 February 2011 - 11:57 PM
Posted 11 February 2011 - 12:36 AM
#include <iostream>
using namespace std;
long sin;
char fsin[12];
char temp[12];
char outSin(sin){
int i, k;
sin = char fsin[12];
for (i=0; i<12; i++) {
k=11;
temp [k] = fsin[i];
if (k==4||k==7) {
temp [k] = "-";
k--;
}
k--;
}
return temp;
}
int main() {
cin >>sin;
while (sin > 0) {
cout<<sin % 10;
sin /= 10;
}
cout<<"Here is your SIN: ";
outSin();
cout<<endl;
system ("pause");
return 0;
}
This post has been edited by YBang: 11 February 2011 - 12:40 AM
Posted 11 February 2011 - 02:00 AM
char outSin(sin){
// your code
}
char[] outSin(double sin){
// your code
}
This post has been edited by chinchang: 11 February 2011 - 02:01 AM
|
|
Query failed: connection to localhost:3312 failed (errno=111, msg=Connection refused).
|
