### Please help..

hello guys..
i tried to write this program several times.. i'am almost close..

the program is :
Write a program that prompts the user to input an integer between 0 and 35. If the number is less than or equal to 9, the program should output the number; otherwise, it should output A for 10, B for 11, ..., and Z for 35. (Hint: use the cast operator, static_cast<char>( ), for numbers >= 10)

i didnt know how to use the static_cast well..?!?!
anyy helpp pleasee????!?!
i have an exam after 3 days
 ``1234567891011121314151617181920212223242526272829`` ``````#include #include using namespace std; int main () { for(;;){ int num; cout<<"Type a number between 0 and 35 (num>35 exits)"<>num; if (num>=0&&num<=9) cout<<"Num: "<=10&&num<=35) cout<<"Letter: "<(num+55)< Hex: 41, row->4 column->1 ==> Dec: 65=16*(4)+(1) // Your A has a value of Dec 10, the difference is 65-10=55, // this is the offset(+55) for num // static_cast: // http://www.cplusplus.com/doc/tutorial/typecasting/ // static_cast(num+55) similar to (char)(num+55) return 0; } ``````
Last edited on
Thankss man
thank u very much
Topic archived. No new replies allowed.