Question about Operating Systems

1 Answer

I need a program in turbo c that would count the vowels in the sentence using for loap

Posted by on

1 Answer

  • Level 2:

    An expert who has achieved level 2 by getting 100 points

    MVP:

    An expert that gotĀ 5 achievements.

    Governor:

    An expert whose answer gotĀ voted for 20 times.

    Hot-Shot:

    An expert who has answered 20 questions.

  • Expert
  • 55 Answers

Here's an example:

//This is the array of characters that holds your sentence.
char YourSentance[];

//This is all of the Vowels, note that capitol and lower case are
//considered different.
char Vowels[]={'a','e','i','o','u','A','E','I','O','U'};

//This holds the counter of how many vowels we find
int NumVowels=0;

//Loop through the Sentence using i until we encounter a 0
//which signifies the end of the string
for(int i=0;YourSentance[i]!=0;i++) {
//Now loop through the vowels
for(int x=0;Vowels[x]!=0;x++) {
//Check to see if this character is a vowel
if(YourSentance[i]==Vowels[x]) {
//If it is, increment NumVowels, and end the loop early
NumVowels++;
break; // This line optional
}
}
}

//Now NumVowels contains a count of how many vowels
//we found
printf("There are %i vowels in the sentence.\n",NumVowels);

Posted on Feb 29, 2008

Add Your Answer

Uploading: 0%

my-video-file.mp4

Complete. Click "Add" to insert your video. Add

×

Loading...
Loading...

Related Questions:

1 Answer

How to Run Turbo Pascal Full Screen mode on Windows 7


Now that's a program I've not worked with in a while ;-) I haven't used it since my early high school days in the 1990s. Turbo is a really old application that has been around for ages- unfortunately, being as such, it is only capable of developing 16-bit DOS applications, which has, for better or worse, gone the way of the dinosaur. In the x64-bit versions of Windows Vista and 7, all 16-bit native support has actually gone out the window in favor of 32-bit and 64-bit application development. This is why DosBox was invented- it is a true 16-bit DOS environment (much like command.com and CMD.exe used to be) that is capable of running all the older DOS programs that are no longer compatible with Windows.
When you run Turbo from the DOSbox program, press ALT-ENTER and it will fullscreen whatever you're working with.
Hope this helps,
- Vern

Mar 24, 2012 | Operating Systems

2 Answers

HOW TO RUN TURBO C IN 64 BIT WINDOWS 7


Hi,

Turbo C/C++

64 Bit operating systems like Windows Xp64, Windows Vista64, and Window 7 will no longer run 16 bit applications and this includes Turbo C 2.01/Turbo C++ 3.0/3.1 or the programs they produce.
Turbo C 2.0 was first released in 1989, Turbo C++ 3.1 in 1991 making these programs nearly two decades old. They are just too old to run on modern PCs.

Upgrade To Modern Compiler

Note that Turbo C/C++ is very very very very old and produces 16 bit programs which no long run on many modern computers. So the best advice is to upgrade to a new compiler. There are many free compilers out there that you can use.

Free Compilers:
  • Microsoft Express 2008 -- Great compiler and comes with a nice IDE (Visual Studio)
  • MinGW -- Command line compiler but there are many IDEs that use it such as Code::Blocks, Eclipse, Dev-C++
  • Borland C++ 5.5 -- Will compile Turbo C++ programs (including graphics.h) but produces 32bit code (slightly better than Turbo C) Only includes command line tools.
  • DigitalMars -- Its still old but at least it produces 32bit programs (better than Turbo C). You might stumble across D++ which is a very powerful language derivative of C++.
  • OpenWacom -- Again, nearly as old as Turbo C, but it produces more modern 32bit applications! (this project is still active too).
If you are just working with C there is:
  • Pelles -- and excellent modern C compiler and IDE. Pelles also has the new TR1 libraries available so you can use regex and other new features. As well as support for many older libraries.
  • LCC-Win32 -- Used as the basis for many of the research compilers.
  • Tiny C -- is said to produce very fast programs.
.
All of the above are Free and all excellent replacements for Turbo C which is so old it will not even run on your computer.


Regards.

May 24, 2010 | Microsoft Windows Vista Ultimate Edition

1 Answer

How to run turbo c++ in windows 7 64-bit os


Is the program not installing at all? Or it just won't run?

Try using the compatibility options for it. If the program did in act install, open up the start menu, and right click on the application. Select properties. There is a compatibility tab. On that tab you can select the Checkbox to run the program in compatibility mode - WindowsXP SP2 usually works for most legacy apps.

Feb 06, 2010 | Microsoft Windows Vista Ultimate Edition

1 Answer

Is any turbo c and c++ compatible with windows vista OS.


Highly doubtful since both the Turbo C and Turbo C++ were created for DOS, Windows 3.0 and Windows 3.1. You might be able to use Vista's compatibility mode to run the program with disabled Vista features but I doubt it for a program that old. I think Vista's compatibility mode only goes down to Windows 98 SE.

Hope this helps...

Oct 31, 2009 | Microsoft Windows Vista Ultimate Edition

1 Answer

C++ problem BGI ERROR


The most probable reason why the program is not working is because your Turbo C++ BGI Graphics folder is not "c:\\tc\\bgi".
Correct the path and it should work.

If you're sure that your path is correct, press Alt+F5 and paste the error received.

Jan 23, 2009 | Operating Systems

1 Answer

Write a program for analyzing which of severaol diff.vowels ,cont


#
# Since no language was specifiec, here's a solution in the
# gawk dialect of awk.
#
# Familiarity with awk is assumed, so only minimal comments
# are present. I have a version with more comments...
#


BEGIN {
IGNORECASE = 1
}

{ r0 = $0 } # Copy the input record into the variable r0, for efficiency

wc += gsub(/[[:blank:]]+/, "", r0) {} # Destructively count all the white spaces in r0

vc += gsub(/[AEIOU]/, "", r0) {} # Destructively count all the vowels in r0

cc += gsub(/[BCDFGHJKLMNPQRSTVWXYZ]/, "", r0) {} # Destructively count all the consonants in r0

END {
printf("%d vowel%s\n", vc, (vc != 1) ? "s" : "")
printf("%d consonant%s\n", cc, (cc != 1) ? "s" : "")
printf("%d white space%s\n", wc, (wc != 1) ? "s" : "")
}

Jan 02, 2009 | Operating Systems

1 Answer

What is the meaning of vowel? what are the uses of it?


In all languages, vowels form the nucleus or peak of syllables, whereas consonants form the onset and (in languages which have them). However, some languages also allow other sounds to form the nucleus of a syllable.

Nov 11, 2008 | Microsoft Windows Vista Ultimate Edition

1 Answer

Turbo c++ programming is not working


If turbo c++ is placed in any other drive than c drive then u hv to provide correct path by going through Option >>directories>>Library Directories and provide exact path where ur turbo c++ is placed.

Oct 06, 2008 | Microsoft Windows XP Professional With...

2 Answers

Fullscreen mode using turbo c in windows vista


try to download the turbo c in vista go google it email me i'll give you the link ronaldsuboc@yahoo.com

Sep 17, 2008 | Microsoft Windows Vista Ultimate Edition

2 Answers

Does Vista Support Turbo C/C++??


google vista + turbo c.... you need a program called dosbox and it's a very lenghty explanation but it is possible to do

Aug 25, 2008 | Microsoft Windows Vista Ultimate Edition

Not finding what you are looking for?
Operating Systems Logo

Related Topics:

981 people viewed this question

Ask a Question

Usually answered in minutes!

Top Operating Systems Experts

Les Dickinson
Les Dickinson

Level 3 Expert

18299 Answers

Brian Sullivan
Brian Sullivan

Level 3 Expert

27725 Answers

Prashant  Sharma
Prashant Sharma

Level 3 Expert

1127 Answers

Are you an Operating System Expert? Answer questions, earn points and help others

Answer questions

Manuals & User Guides

Loading...