Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ASCII code of c++
#1
ASCII code of null character is always zero .WE represent the ASCII Code by "/0".
All string are terminated with null character. its Means ASCII code are use to terminate a string


#include <iostream>
using namespace std;

Code:
int main(){ char ascii; int numeric; cout << "Give character: "; cin >> ascii; cout << "Its ascii value is: " << (int) ascii << endl; cout << "Give a number to convert to ascii: "; cin >> numeric; cout << "The ascii value of " << numeric << " is " << (char) numeric; return 0; }

0300-9520262
Get solution in 24 hour
|cpmputer & internetConfusedmileys81:[SIZE="4"][SIZE="3"]....[/SIZE][/SIZE]
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  ASCII code is binary numbers of 0 and 1 in C++ 2012 Vuhelper 0 2,278 01-04-2012, 10:41 PM
Last Post: Vuhelper
  int x[10]; x[0]= 1; x[1]=2; if following code is executable in C++ 2012 Vuhelper 0 1,935 01-04-2012, 10:17 PM
Last Post: Vuhelper
  array project code c++ 2011 Vuhelper 0 1,273 12-10-2011, 06:32 PM
Last Post: Vuhelper
  factorial in C++ code 2011 Vuhelper 0 943 12-10-2011, 06:31 PM
Last Post: Vuhelper
  ASCII to char conversion code in C++ 2011 Vuhelper 0 1,721 11-05-2011, 05:01 PM
Last Post: Vuhelper
  C++ with loop code 2011-12 Vuhelper 0 976 09-18-2011, 07:09 PM
Last Post: Vuhelper
  Revised Student Record Code written in C++ 2011-12 Vuhelper 0 1,478 09-04-2011, 07:18 AM
Last Post: Vuhelper
  c++ code check this code 2011-12 Vuhelper 0 1,097 09-04-2011, 07:17 AM
Last Post: Vuhelper
  Sorting code in c++ Vuhelper 0 1,003 06-09-2011, 10:03 PM
Last Post: Vuhelper
  describe the highlighted code//header files #include #include using namespace saneha 0 1,814 05-02-2011, 06:45 PM
Last Post: saneha

Forum Jump:


Users browsing this thread: 1 Guest(s)