BLOG - Rico -

Blog - Rico -

Rabu, 09 Maret 2011

Program Bahasa C pada LINUX (LA3)

ini adalah program dari laporan akhir dari praktikum sistem operasi pertemuan ke 3
semoga bisa membantu :D

 //PROGRAM 1
#include <stdio.h>
#include <conio.h>
main()
{
int baris,kolom;
clrscr();
for(baris=6; baris>0;baris--)
{
    for(kolom=1;kolom<baris;kolom++)

    {
        printf("%d", kolom);
    }
    printf("%d\n",baris);
}
for(baris=2; baris<7;baris++)
{
    for(kolom=1;kolom<baris;kolom++)
    {
        printf("%d", kolom);
    }
    printf("%d\n",baris);
}
getch();
}


// PROGRAM 2
#include<stdio.h>
#include<conio.h>
#include<math.h>
main()
{
clrscr();
int x,i;
printf("     x        1/x        x^2        x^3        \n");
printf("-----------------------------------------------------\n");
x=1;
while(x<=10)
    {
    printf(" %5d       %8.5f    ",x,1.0/x);
    i=2;
    while(i<=3)
        {
        printf("%8.2f ", pow(x,i));
        i++;
        }
    printf("\n");
    x++;
    }
getch();
}
Share this post
  • Share to Facebook
  • Share to Twitter
  • Share to Google+
  • Share to Stumble Upon
  • Share to Evernote
  • Share to Blogger
  • Share to Email
  • Share to Yahoo Messenger
  • More...

0 comments

:) :-) :)) =)) :( :-( :(( :d :-d @-) :p :o :>) (o) [-( :-? (p) :-s (m) 8-) :-t :-b b-( :-# =p~ :-$ (b) (f) x-) (k) (h) (c) cheer

 
Posts RSSComments RSSBack to top
© 2011 BLOG - Rico - ∙ Designed by BlogThietKe
Released under Creative Commons 3.0 CC BY-NC 3.0