Please Guys, Can You Tell Me How Exactly I Can Write The Source For This Program:
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, C for 12, . . ., and Z for 35. (Hint: Use the cast operator, static_cast%26lt;char%26gt; ( ), for numbers%26gt;=10.
PLEASE: I Need To Write This C++ Program ..?
#include%26lt;iostream.h%26gt;
main()
{
int n,t;
t=55;
cout%26lt;%26lt;"enter a number between 1 and 35";
cin%26gt;%26gt;n;
if((n%26gt;0)%26amp;%26amp;(n%26lt;10))
cout%26lt;%26lt;n;
else if((n%26gt;10)%26amp;%26amp;((n%26lt;36))
cout%26lt;%26lt;(char)(n+t);
else
cout%26lt;%26lt;"enter valid number";
return 0;
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment