is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.
CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.
Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.
Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.
Vamsi, your idea is very good. Here is the working code :
- dvsnm February 23, 2008#include <iostream>
#include <string>
using namespace std;
string convert(int num);
int main(int argc, char* [])
{
unsigned int num = 0;
string output1 = "";
string output2 = "";
cout << "Please input the number: " << endl;
cin >> num;
int out1 = num/1000;
int out2 = num%1000;
if(out1)
{
output1 = convert(out1) + " " + " thousand ";
cout << "Returned from convert first time" << endl;
}
if(out2)
{
output2 = convert(out2);
output1 = output1 + output2;
}
cout << "Output is: " << output1 << endl;
}
string convert(int num)
{
string word1[] = {"zero", "one", "two", "three", "four", "five", "six",
"seven", "eight", "nine", "ten", "eleven", "twelve",
"thirteen", "fourteen", "fifteen", "sixteen",
"seventeen", "eighteen", "nineteen"};
string word3[] = {"zero", "ten", "twenty", "thirty", "forty", "fifty",
"sixty", "seventy", "eighty", "ninety"};
string send = "";
int temp = 0;
temp = num/100;
if(temp > 0)
{
send = word1[temp] + " " + "hundred " + "and";
}
num = num%100;
if(num > 0)
{
if(num > 10 && num < 20)
{
send = send + " " + word1[num];
}
else
{
temp = num/10;
if(temp >= 0)
send = send + " " + word3[temp];
num = num%10;
if(num > 0)
send = send + " " + word1[num];
}
}
return send;
}