LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 04-22-2005, 09:12 PM   #1
huno
Member
 
Registered: May 2002
Distribution: Slackware 9.1
Posts: 161

Rep: Reputation: 30
loop in strin ( C++)


how can i print from A to Z using For Loop;?
 
Old 04-23-2005, 05:00 AM   #2
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: ubuntu
Posts: 2,524

Rep: Reputation: 93
Re: loop in strin ( C++)

Quote:
Originally posted by huno
how can i print from A to Z using For Loop;?
Code:
/*** file: az.cpp ***/

#include <iostream>

int main()
{
        for (char i = 'A'; i <= 'Z'; ++i)
                std::cout << i << std::endl;
        return 0;
}
Compile & run:
Code:
g++ -Wall -o az az.cpp
./az
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
while loop or for loop? mijohnst Programming 18 11-21-2005 04:48 PM
WHILE LOOP in 'C' ']['HeBroken Programming 4 10-29-2004 01:42 AM
while-loop Thomas23 Programming 4 05-24-2004 03:35 PM
for loop klfreese Programming 16 08-11-2003 11:09 AM
help with the following C loop ..... purpleburple Programming 12 08-06-2002 10:32 PM


All times are GMT -5. The time now is 08:54 AM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration