# Thread: displaying characters per line and checking prime numbers

1. ## displaying characters per line and checking prime numbers

so i have a project for my class that has to have the user specify how many characters per line they want the alphabet to be displayed (1-26). thats where im lost. then the second part is that i have to check to see if a number is a prime number. i have to use "for" statements for both of them. please help.

2. So how much of it can you do?

3. i dont even know where to start.. i just need something to go from. i dont want my assignment done for me i just need a starting point

4. How about beginning with displaying the alphabet in any style you choose?

Then post that so we can see where you're at, and guide you to the next level.

5. Code:
```
int c,cpl,pn,sd,vb;

cout << "\n1) Print the alphabet using a specified number of characters per line.";
cout << "\n2) Check to see if a number is prime.";
cout << "\n3) Get the sum of the digits.";
cout << "\n4) Check to see if the number is a valid base.";
cout << "\n5) Exit\n";
cout << "Choice: ";
cin >> c;
switch(c){
case 1:
cout << "How many characters per line? ";
cin >> cpl;
cout <<"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" << endl;break;
case 2:
cout << "Enter a number to check if it is a prime number.";
cin >> pn;
cout << "You want to see if " << pn << " is prime." << endl; break;```
I'm going to need to use a for loop for both of these options but as to the logic that im going to use im clueless

6. Consider this snippet.
Code:
```#include <iostream>
#include <string>

int main ( ) {
std::string a = "abcd";
for ( int i = 0 ; i < a.length(); i++ ) {
std::cout << a[i] << std::endl;
}
return 0;
}```