Thread: can someone help me on this string of char

  1. #1
    Registered User
    Join Date
    Nov 2005
    Posts
    71

    can someone help me on this string of char

    can someone please let me know

    how to make this code:

    00=A
    01=B
    02=C
    .
    .
    .
    until
    .
    .
    .
    26=Z

    and when user enter number for example 02, the output will display C. is very simple program that i couldnt even finish up, can some one please....

    i hope i can use string..

    this is what i being doing and thinking....but couldnt get wat i want

    Code:
       for(int i = 65; i <= 90; i++)
       {
           cout<<char(i)<<" ";
       }

  2. #2
    Registered User
    Join Date
    Dec 2005
    Location
    the Netherlands
    Posts
    5
    Try this:

    Code:
    #include <iostream.h>
    
    int main ()
    {
    	char something[]="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
    	
    	for (int i = 0; i < 26; i++)
    	{
    		if (i < 10)
    		{
    			cout << "0" << i << "=";
    		} else
    		{
    			cout << i << "=";
    		}
    		
    		cout << something[i] << endl;
    	}
    }

  3. #3
    Registered User
    Join Date
    Nov 2005
    Posts
    71
    thnx a lot man this wil help... appreciate it lo t

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. char Handling, probably typical newbie stuff
    By Neolyth in forum C Programming
    Replies: 16
    Last Post: 06-21-2009, 04:05 AM
  2. Replies: 8
    Last Post: 04-25-2008, 02:45 PM
  3. String issues
    By The_professor in forum C++ Programming
    Replies: 7
    Last Post: 06-12-2007, 09:11 AM
  4. Linked List Help
    By CJ7Mudrover in forum C Programming
    Replies: 9
    Last Post: 03-10-2004, 10:33 PM
  5. comparing fields in a text file
    By darfader in forum C Programming
    Replies: 9
    Last Post: 08-22-2003, 08:21 AM