how to write a program of integer, charecter and real in c++??
Answers
Answered by
1
#include <iostream>
using namespace std;
int main() {
int number; char character; cout << "Type in a character:\n";
cin >> character; number = character; cout << "The character '" << character;
cout << "' is represented as the number ";
cout << number << " in the computer.\n";
return 0;
}
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
float number;
cout << "Type in a real number.\n";
cin >> number; cout.setf(ios::fixed);
cout.precision(2); cout << "The square root of " << number << " is approximately ";
cout << sqrt(number) << ".\n";
return 0;
}
using namespace std;
int main() {
int number; char character; cout << "Type in a character:\n";
cin >> character; number = character; cout << "The character '" << character;
cout << "' is represented as the number ";
cout << number << " in the computer.\n";
return 0;
}
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
float number;
cout << "Type in a real number.\n";
cin >> number; cout.setf(ios::fixed);
cout.precision(2); cout << "The square root of " << number << " is approximately ";
cout << sqrt(number) << ".\n";
return 0;
}
aditijadhav:
thnxxxxxxx 4 helping............
Answered by
0
Answer: ubjbjmAnswer: ubjbjmAnswer: ubjbjmAnswer: ubjbjm
Similar questions