I C++ write a program where the program picks a character . Then program then prints the character and its ASCII integer value.
#include <iostream> #include <cstdlib> #include <ctime> using namespace std; int main(){ char ch; int ascii; srand(time(0)); ch = (char)(rand()%256); ascii = (int)ch; cout<<"Ascii integer value for character '"<<ch<<"' is "<<ascii<<endl; return 0; }
Get Answers For Free
Most questions answered within 1 hours.