62 572
Assignments Done
99%
Successfully Done
In June 2018

Answer to Question #21799 in C++ for Sharone

Question #21799
Hello, how are you?

Using a for loop, how can I assign the alphabet to numbers. Ex: A=1, B=2, etc...
Expert's answer

#include <iostream>
#include <conio.h>

using namespace std;

int main()
{
char
alphabet[]={'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'};
for(int i=0;i<26;i++){
cout<<(i+1)<<"
"<<alphabet[i]<<"
";
}
getch();
return 0;
}


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions