06-07-2011, 07:01 PM
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;
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 & internet
mileys81:[SIZE="4"][SIZE="3"]....[/SIZE][/SIZE]
