Answers for "converting ascii to char in c++"

C++
0

how to convert ascii to char in cpp

#include<bits/stdc++.h>
using namespace std;
int main(){
  char a=char(97); //ascii value of a
  cout<<a;
}
Posted by: Guest on August-15-2021
0

c++ program to convert character to ascii

/*Q; Design a program that take a char value from the 
user and display the ASCII value of the entered value?*/
#include<iostream>
using namespace std;
int main()
{
	char a;
	cin>>a;
	int num=(int)a;
	cout<<"\nASCII value of "<<a<<"="<<num;
	return 0;
}
Posted by: Guest on March-17-2022

Code answers related to "converting ascii to char in c++"

Browse Popular Code Answers by Language