<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>'write a program uses nested if statments?' Thread RSS Feed</title>
    <link>http://www.programmersheaven.com/</link>
    <description>Contains the latest posts from the thread 'write a program uses nested if statments?' posted on the 'Pascal' forum at Programmer's Heaven.</description>
    <language>en</language>
    <copyright>Copyright 2013 Programmers Heaven</copyright>
    <pubDate>Wed, 19 Jun 2013 13:30:40 -0700</pubDate>
    <lastBuildDate>Wed, 19 Jun 2013 13:30:40 -0700</lastBuildDate>
    <generator>Argotic Syndication Framework 2007.3.0.1, http://www.codeplex.com/Argotic</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>360</ttl>
    <image>
      <url>http://www.programmersheaven.com/images/ph.gif</url>
      <title>Programmers Heaven</title>
      <link>http://www.programmersheaven.com/</link>
      <width>88</width>
      <height>31</height>
    </image>
    <item>
      <title>write a program uses nested if statments?</title>
      <link>http://www.programmersheaven.com/mb/pasprog/425607/425607/write-a-program-uses-nested-if-statments/</link>
      <description>write a program that asks for three names and then uses nested if statments to display them in alphabetical order.&lt;br /&gt;
&lt;br /&gt;
plz can anyone figure this out i have spent a few hours trying to figure it out&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/425607/425607/write-a-program-uses-nested-if-statments/</guid>
      <pubDate>Sun, 06 Nov 2011 05:44:29 -0700</pubDate>
      <category>Pascal</category>
    </item>
    <item>
      <title>Re: write a program uses nested if statments?</title>
      <link>http://www.programmersheaven.com/mb/pasprog/425607/426164/re-write-a-program-uses-nested-if-statments/#426164</link>
      <description>: write a program that asks for three names and then uses nested if &lt;br /&gt;
: statments to display them in alphabetical order.&lt;br /&gt;
: &lt;br /&gt;
: plz can anyone figure this out i have spent a few hours trying to &lt;br /&gt;
: figure it out&lt;br /&gt;
: &lt;br /&gt;
&lt;pre class="sourcecode"&gt;
{
not a very elegant way of doing it but it should work
}
program nestedif ;

var
     name : array[1 .. 3] of string ;

begin
     {
          get the three names -- we could us a loop here
     }
     write ('Enter first name  ') ;
     readln (name[1]) ;
     write ('Enter second name ') ;
     readln (name[2]) ;
     write ('Enter third name  ') ;
     readln (name[3]) ;

     writeln (name[1]) ;
     writeln (name[2]) ;
     writeln (name[3]) ;
     {
          sort and print
     }
     if (name[1] &amp;lt;= name[2]) and (name[1] &amp;lt;= name[3]) then begin
          {
               name[1] is first
          }
          writeln (name[1]) ;
          if name[2] &amp;lt;= name[3] then begin 
               writeln (name[2]) ;
               writeln (name[3])
          end
          else begin
               writeln (name[3]) ;
               writeln (name[2])
          end
     end
     else if (name[2] &amp;lt;= name[1]) and (name[2] &amp;lt;= name[3]) then begin
          {
               name[2] is first
          }
          writeln (name[2]) ;
          if name[1] &amp;lt;= name[3] then begin
               writeln (name[1]) ;
               writeln (name[3])
          end
          else begin
               writeln (name[3]) ;
               writeln (name[1])
          end

     end
     else if (name[3] &amp;lt;= name[1]) and (name[3] &amp;lt;= name[2]) then begin
          {
               name[3] if first
          }
          writeln (name[3]) ;
          if name[1] &amp;lt;= name[2] then begin
               writeln (name[1]) ;
               writeln (name[2])
          end
          else begin
               writeln (name[2]) ;
               writeln (name[1])
          end
     end
end.


&lt;/pre&gt;&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/425607/426164/re-write-a-program-uses-nested-if-statments/#426164</guid>
      <pubDate>Fri, 09 Dec 2011 12:19:39 -0700</pubDate>
      <category>Pascal</category>
    </item>
  </channel>
</rss>