write a program in C++ to output complete set of small english alphabe

  • (2 Pages)
  • +
  • 1
  • 2

15 Replies - 2355 Views - Last Post: 20 May 2009 - 08:27 AM Rate Topic: -----

#1 jilawatan  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 19-May 09

write a program in C++ to output complete set of small english alphabe

Post icon  Posted 19 May 2009 - 09:03 PM

write a program in C++ to output complete set of small english alphabets by using for loop statement.Deired output should be as follows:
abcdefghijklmnopqrstuvwxyz.
Is This A Good Question/Topic? 0
  • +

Replies To: write a program in C++ to output complete set of small english alphabe

#2 chris772  Icon User is offline

  • D.I.C Head

Reputation: 5
  • View blog
  • Posts: 190
  • Joined: 13-March 09

Re: write a program in C++ to output complete set of small english alphabe

Posted 19 May 2009 - 09:05 PM

Don't double post. We don't just give you code, you need to try it yourself and then we can help you with any errors or problems you have. Try using an array of letters and increment...
Was This Post Helpful? 0
  • +
  • -

#3 no2pencil  Icon User is offline

  • Admiral Fancy Pants
  • member icon

Reputation: 5322
  • View blog
  • Posts: 27,232
  • Joined: 10-May 07

Re: write a program in C++ to output complete set of small english alphabe

Posted 19 May 2009 - 09:06 PM

Stuff your string into an array & loop through it.

** hint, there are twenty six letters in the alphabet.

Let us know if you have any questions, or run into any bumps.
Was This Post Helpful? 0
  • +
  • -

#4 IngeniousHax  Icon User is offline

  • |>|20-514<|{3|2

Reputation: 78
  • View blog
  • Posts: 1,358
  • Joined: 28-March 09

Re: write a program in C++ to output complete set of small english alphabe

Posted 19 May 2009 - 09:42 PM

Or, really show off to your teacher and make a simple calculation as to what the letters equate to in ASCII and than have those numbers converted into letters and use a for loop to get all the letters. Not too difficult, just try it out.
Was This Post Helpful? 0
  • +
  • -

#5 no2pencil  Icon User is offline

  • Admiral Fancy Pants
  • member icon

Reputation: 5322
  • View blog
  • Posts: 27,232
  • Joined: 10-May 07

Re: write a program in C++ to output complete set of small english alphabe

Posted 19 May 2009 - 09:43 PM

That's a much better idea :)
Was This Post Helpful? 0
  • +
  • -

#6 IngeniousHax  Icon User is offline

  • |>|20-514<|{3|2

Reputation: 78
  • View blog
  • Posts: 1,358
  • Joined: 28-March 09

Re: write a program in C++ to output complete set of small english alphabe

Posted 19 May 2009 - 09:45 PM

Indeed, much can be taught through sucha simple program. My teacher had us build a program that ran through the printable ASCII characters. Something like 128 characters I think...Not too sure. And print the corresponding number on the left....It was neat, yet at the time was frustrating since I didn't know anything about anything.
Was This Post Helpful? 0
  • +
  • -

#7 KYA  Icon User is offline

  • g++ jameson.cpp -o beverage
  • member icon

Reputation: 3102
  • View blog
  • Posts: 19,142
  • Joined: 14-September 07

Re: write a program in C++ to output complete set of small english alphabe

Posted 19 May 2009 - 09:49 PM

I want to say 32 - 76, but that's probably wrong and off the top of my head.
Was This Post Helpful? 0
  • +
  • -

#8 no2pencil  Icon User is offline

  • Admiral Fancy Pants
  • member icon

Reputation: 5322
  • View blog
  • Posts: 27,232
  • Joined: 10-May 07

Re: write a program in C++ to output complete set of small english alphabe

Posted 19 May 2009 - 09:50 PM

Off the top of my head I think it's 48 through... ? That's the main reason I still have a DOS book at my office. They were always good for having ascii charts in the back.
Was This Post Helpful? 0
  • +
  • -

#9 KYA  Icon User is offline

  • g++ jameson.cpp -o beverage
  • member icon

Reputation: 3102
  • View blog
  • Posts: 19,142
  • Joined: 14-September 07

Re: write a program in C++ to output complete set of small english alphabe

Posted 19 May 2009 - 09:53 PM

Shit, we're way off if we're assuming lowercase

http://www.asciichart.com/
Was This Post Helpful? 0
  • +
  • -

#10 no2pencil  Icon User is offline

  • Admiral Fancy Pants
  • member icon

Reputation: 5322
  • View blog
  • Posts: 27,232
  • Joined: 10-May 07

Re: write a program in C++ to output complete set of small english alphabe

Posted 19 May 2009 - 09:56 PM

Doh... I was thinking the numbers 1 though 9. Geez-low-eeze.
Was This Post Helpful? 0
  • +
  • -

#11 Pijuvwy  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 36
  • Joined: 19-May 09

Re: write a program in C++ to output complete set of small english alphabe

Posted 19 May 2009 - 10:39 PM

View Postno2pencil, on 19 May, 2009 - 08:56 PM, said:

Doh... I was thinking the numbers 1 though 9. Geez-low-eeze.


97 to 122 I think.
Was This Post Helpful? 0
  • +
  • -

#12 BlakeJustBlake  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 26
  • View blog
  • Posts: 441
  • Joined: 15-February 09

Re: write a program in C++ to output complete set of small english alphabe

Posted 19 May 2009 - 11:01 PM

Much easier idea: make a char that is equal to 'a', then put it through a for loop that goes 26 times and each time output the char, then increment the char.
Was This Post Helpful? 0
  • +
  • -

#13 IngeniousHax  Icon User is offline

  • |>|20-514<|{3|2

Reputation: 78
  • View blog
  • Posts: 1,358
  • Joined: 28-March 09

Re: write a program in C++ to output complete set of small english alphabe

Posted 19 May 2009 - 11:03 PM

Yeah, if ya wanna make it all easy and such. LoL. That's what makes programming entertaining. All the different ways you can do things.

The ASCII chart is 128 characters long...0-127. I was saying I had to print out the entire printable ascii chart for one of my projects, not just the alphabet.

This post has been edited by IngeniousHax: 19 May 2009 - 11:04 PM

Was This Post Helpful? 0
  • +
  • -

#14 BlakeJustBlake  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 26
  • View blog
  • Posts: 441
  • Joined: 15-February 09

Re: write a program in C++ to output complete set of small english alphabe

Posted 19 May 2009 - 11:10 PM

Then you'd set the char to '\x0' and then increment it 128 times.
Was This Post Helpful? 0
  • +
  • -

#15 IngeniousHax  Icon User is offline

  • |>|20-514<|{3|2

Reputation: 78
  • View blog
  • Posts: 1,358
  • Joined: 28-March 09

Re: write a program in C++ to output complete set of small english alphabe

Posted 19 May 2009 - 11:27 PM

-.-;; You and your quick solutions.
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2