ERICLINUX: Ejercicios Pascal (II) - Suma de números.

18/1/08

Ejercicios Pascal (II) - Suma de números.

En el articulo anterior expliqué como imprimir en pantalla.
Realizamos el conocido "Hola Mundo".
Hoy vamos a explicar como ingresar 2 números, mostrarlos en pantalla, sumarlos y mostrar el resultado.

El código es el siguiente.
program nuevo;
uses crt;
var
a,b,c:integer;
Begin

clrscr;
c:=0;
writeln ('Ingrese un numero '); readln (a);
writeln ('Ingrese otro numero '); readln (b);
c:= a + b;
writeln ('El resultado es ',c);
readkey;
end.
Explicación.

Var: Se utiliza para definir las variables, en éste caso son a,b y c. El otro comando integer nos permite definir a las variables como enteras.

c:=0: Debemos indicar que C tiene un valor de 0.

readln (a): Lo utilizamos para poder ingresar los números. Si no lo colocamos no podremos ingresar datos.

c:= a + b: Realizamos la suma.

writeln ('El resultado es ',c): Como verán nos muestra una ',c) ésto se utiliza para abreviar un poco el código.
Es lo mismo que poner por ejemplo:
writeln ('El resultado es ');
writeln (c);
Cómo ejercitación pueden realizarlo con más números y restando.

Atentamente Eric.

En el articulo anterior expliqué como imprimir en pantalla.
Realizamos el conocido "Hola Mundo".
Hoy vamos a explicar como ingresar 2 números, mostrarlos en pantalla, sumarlos y mostrar el resultado.

El código es el siguiente.
program nuevo;
uses crt;
var
a,b,c:integer;
Begin

clrscr;
c:=0;
writeln ('Ingrese un numero '); readln (a);
writeln ('Ingrese otro numero '); readln (b);
c:= a + b;
writeln ('El resultado es ',c);
readkey;
end.
Explicación.

Var: Se utiliza para definir las variables, en éste caso son a,b y c. El otro comando integer nos permite definir a las variables como enteras.

c:=0: Debemos indicar que C tiene un valor de 0.

readln (a): Lo utilizamos para poder ingresar los números. Si no lo colocamos no podremos ingresar datos.

c:= a + b: Realizamos la suma.

writeln ('El resultado es ',c): Como verán nos muestra una ',c) ésto se utiliza para abreviar un poco el código.
Es lo mismo que poner por ejemplo:
writeln ('El resultado es ');
writeln (c);
Cómo ejercitación pueden realizarlo con más números y restando.

Atentamente Eric.

17 COMENTARIOS:

Anónimo | 21 de marzo de 2010, 18:46  

muchas gracias te quiero me resolviste la vida

Anónimo | 19 de abril de 2010, 12:36  

que onda vos mira necesito muxa ayuda con pascal ke me rekomiendas

Anónimo | 18 de mayo de 2010, 11:45  

que onda cuas fijate que tengo que entregar un proyecto de un juego que sume multiplique divida reste y que tenga su nivel oral

Anónimo | 20 de mayo de 2010, 22:10  

uses crt;

clrscr;

Perdonen; ¿por qué usan estos?, ¿que son?

Anónimo | 7 de mayo de 2012, 9:19  

graciaas

Anónimo | 17 de febrero de 2013, 23:15  

hello there and thank you for your information – I've certainly picked up anything new from right here. I did however expertise several technical issues using this web site, as I experienced to reload the website lots of times previous to I could get it to load properly. I had been wondering if your web host is OK? Not that I'm complaining,
but sluggish loading instances times will very frequently affect your placement in google and could damage your
high quality score if advertising and marketing with Adwords.
Well I'm adding this RSS to my email and could look out for a lot more of your respective exciting content. Ensure that you update this again soon.

Feel free to surf to my weblog :: funbrain games arcade playground

Anónimo | 18 de febrero de 2013, 4:02  

Very nice post. I definitely love this website.
Keep writing!

My homepage: video downloader

Anónimo | 18 de febrero de 2013, 4:49  

Нellο! Тhіs is my first vіsit to уouг blοg!
Wе are а colleсtiоn of volunteers anԁ
ѕtarting а new initiаtive in a сommunity in the ѕame nichе.
Үour blog рrovideԁ us useful information to
work on. You have done a mаrvellοus ϳοb!


Also vіsit my sіte: http://swaggtalk.com/blogs/3978/7941/get-more-customers-with-internet

Anónimo | 22 de febrero de 2013, 6:35  

Tomb Raider, Mega Moolah, Mermaid's Millions, and Blackjack are some of the new Android game apps that have been released from Microgaming's partner,
Spin 3. If you want to enjoy the game thoroughly then
you need to get on board of a reliable online bingo site to get the maximum enjoyment as well as benefit of the game.
The full version has no ads and offers goal alerts for the leagues and teams of your choice.



Also visit my blog post gratis spiele

Anónimo | 22 de febrero de 2013, 10:22  

The fact that Toyοtа chοse to upgrade the exterior styling,
interior quality and interior roominеsѕ of
thе rеdesignеd 2012 Yaris hаtchbacκ гather thаn upgrading
the powertrаin sayѕ a lot about hoω Toуota views the needs of small cаг buyerѕ.
Anothеr thіng you'll need is some strength to endure, because there's a good
chаncе you'll be your own producer for the show or perhaps the best producer the show has. Proffering multifarious benefits to the advertisers, it is a quintessential resort for companies big or small.

My web site :: radiosender

Anónimo | 22 de febrero de 2013, 19:57  

Good ρost but I was wanting tο know іf you could writе a litte more on thіs subject?
I'd be very thankful if you could elaborate a little bit further. Cheers!

my web blog; Read A lot more

Anónimo | 25 de febrero de 2013, 15:30  

These five free basketball game apps for the i - Phone will surely help you get your
game on. Resident Evil 2 is the undisputed
king daddy in the world of early survival horror. In fact an ideal online
casino will make the entire gaming experience a pleasurable and a real experience to the gamer.



Feel free to surf to my blog post - videos von youtube downloaden

Anónimo | 28 de febrero de 2013, 22:48  

The faсt that Toyota chose to upgrade the eхtеrior stylіng,
interiοr quality and intеrior rοomіneѕs of the reԁesigned 2012 Yaris hatchback rather thаn upgrading
the powеrtгain sаys a lot about how Toyota viewѕ the needs
of small car buyers. Also, by haνing a radiο intегnship in your rеѕume, there іѕ а better chancе for you to
become a DЈ when you apply for a jоb in аny гadio
station in the nation. Еνen if you have a good tωo way radio, it isn't bad to have some kind of receive only radio to get information on.

My blog: http://3.funbax.com

Anónimo | 1 de marzo de 2013, 21:40  

Without the internet, this is not possible to play these novoline games online and even they can't live online that they perform now with public for additional characteristics and completely attractive in a delusion earth to participate in a game. One way to test yourself is to deal yourself hand after hand in front of a mirror and watch yourself as you react to the cards. Even when things seem hopeless, Kiko's narration provides
some great comedy relief.

Take a look at my web page - youtube downloader online

Anónimo | 2 de marzo de 2013, 9:30  

What's up Dear, are you genuinely visiting this web site daily, if so then you will without doubt get nice knowledge.

Also visit my homepage - click through the following web page
My page :: russisches Radio

Anónimo | 12 de marzo de 2013, 3:33  

5. ''. It's a competitive world out there on the world-wide web, but SEO consulting can help you dramatically improve your odds of being found in the din and getting your message across. This can be a great tool when selling products online, as a website can be designed to offer either luxury or bargain-oriented goods, based on traffic analysis. Since Google organic rank can bring in thousands of potential customers, search engine position service firms have made a business of promising high positions in search engine results pages. Examine in detail the shift in the customers' rank, and progress in their positions.
The tips are as follows:-. This means that they
follow only the steps given to them by Google and other major
search engines. The title is supposed to explain the article, and the title is what your readers see when they search for content.
This helps auto dealership websites rank higher in the search
engines results and get more traffic to the website.

They want to know things about how to create effective
copy, general marketing tips and maybe even stuff about social media.
For instance, how many TV viewers then came to your car lot
and purchased a vehicle. Now even that is quickly defining point of Search Engine Optimization (SEO) can lead
to intense discussions about the meaning and purpose of SEO.
Think wine, and keep the URL intact. Create a general, high-level category in which you want to manage all phrases'for example 'global,' 'online,' 'channel,' and so on. A well-formed internal linking structure and good sitemap can ensure all pages of a website being indexed by a search engine. You need to try to find reputed SEO consultants. A person can find all sorts of products available at various prices on the internet. The internet has become an integral part of our lives that according to the latest statistics, almost 1 billion Americans access the internet. SEO requires understanding of various algorithms.

Visit my website ... gracefund.genomyx.ch

Anónimo | 12 de marzo de 2013, 3:33  

5. ''. It's a competitive world out there on the world-wide web, but SEO consulting can help you dramatically improve your odds of being found in the din and getting your message across. This can be a great tool when selling products online, as a website can be designed to offer either luxury or bargain-oriented goods, based on traffic analysis. Since Google organic rank can bring in thousands of potential customers, search engine position service firms have made a business of promising high positions in search engine results pages. Examine in detail the shift in the customers' rank,
and progress in their positions. The tips are as follows:-.
This means that they follow only the steps given
to them by Google and other major search engines. The title is supposed
to explain the article, and the title is what your readers see when they search for content.
This helps auto dealership websites rank higher in
the search engines results and get more traffic to the website.
They want to know things about how to create effective copy, general marketing
tips and maybe even stuff about social media.
For instance, how many TV viewers then came to your car lot and
purchased a vehicle. Now even that is quickly defining
point of Search Engine Optimization (SEO) can lead to intense discussions about the meaning and purpose
of SEO. Think wine, and keep the URL intact. Create a general,
high-level category in which you want to manage all phrases'for example 'global,' 'online,' 'channel,
' and so on. A well-formed internal linking structure and good sitemap can ensure all pages of a website being indexed by a search engine. You need to try to find reputed SEO consultants. A person can find all sorts of products available at various prices on the internet. The internet has become an integral part of our lives that according to the latest statistics, almost 1 billion Americans access the internet. SEO requires understanding of various algorithms.

Also visit my web blog ... gracefund.genomyx.ch
My page - armory.theelderscrollsskyrim.com

Publicar un comentario

Bienvenido a ERICLINUX.
Gracias por tu comentario.

Nota: solo los miembros de este blog pueden publicar comentarios.

Tu comentario será moderado la primera vez que lo hagas al igual que si incluyes enlaces. A partir de ahi no ser necesario si usas los mismos datos y mantienes la cordura. No se publicarán insultos, difamaciones o faltas de respeto hacia los lectores y comentaristas de este blog.