Welcome to collectivesolver - Programming & Software Q&A. A website you can trust. All programs tested and works. Contact: aviboots(AT)netvision.net.il
Bonsai Boy of New York Bonsai Trees and Accessories

BlueHost Web Hosting

Liquid Web iThemes WordPress Hosting

Ecommerce Software - Best Ecommerce Platform Made for You - Free Trial

DreamHost Web Hosting


getResponse autofunnels

Liquid Web Cloud VPS Hosting

11,402 questions

15,552 answers

573 users

How to cast int to char in C++

2 Answers

0 votes
#include <iostream>
 
using namespace std;
 
int main() {
    for (int i = 0; i < 26; i++) {       
          cout << static_cast<char>('a' + i) << endl;
    }   
    
    return 0;
}
 
 
/*
 
run:
 
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
 
*/

 




answered Jun 30 by avibootz
edited Jun 30 by avibootz
0 votes
#include <iostream>

using namespace std;

int main() {
	for (int i = 0; i < 26; i++) {		
		  cout << (char)('a' + i) << endl;
	}
	
	return 0;
}


/*

run:

a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z

*/

 




answered Jun 30 by avibootz
edited Jun 30 by avibootz
...