Blogroll

This is default featured post 1 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured post 2 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured post 3 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured post 4 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured post 5 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

Minggu, 30 Desember 2012

String pascal


String pascal
uses crt;
var
        a:string;
        b,c,d:integer;
 begin
        clrscr;
        write('tulis kata=');readln(a);
        b:=length(a);
        for c:=0 to b do
 begin
        for d:=1 to b-c do
        write(' ',a[d]);
        writeln;
        end;
        readln;
 end.
Input program




Logika program
Setelah program selesai dibuat, selanjutnya program memanggil library data dalam bentuk var bertipe a adalah string, sedagkan b,c,d adalah integer.  Kemudian program berjalan clrscr berfungsi sebagai pembersih data sebelumnya. Program cetak kalimat” tulis kata”,kemudian program membaca” a” sebagai string,.
Kemudian ” b” adalah intger  yang kemudian berhubungan dengan string. Selanjutnya program melakukan pengulangan dengan rumus” for do”, dimana data “C” dimulai dari nol membaca kata dari awal untuk ke data “b”.  sedangkan data” d” dimulai dari 1untuk membaca kata dari depan dan mengurangi kata diakhir satu huruf. Begitulah seterusnya hingga kata itu Cuma tinggal satu huruf saja. Readln berfungsi sebagai pembaca data diatasnya.” End” berfungsi sebagai mengakhiri program.

Output program

Share

Twitter Delicious Facebook Digg Stumbleupon Favorites More