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.

Tampilkan postingan dengan label program membuat rata2 menggunakan for. Tampilkan semua postingan
Tampilkan postingan dengan label program membuat rata2 menggunakan for. Tampilkan semua postingan

Senin, 05 Maret 2012

program membuat rata2 menggunakan for

#include <stdio.h>
#include <stdlib.h>
#include <conio.h>

int main() {
    int x,sigma,i,n;
    float xrt;
    char c;
    for(c='1';c!='5';){
    system("cls");
    printf("================================\n");
    printf("**PROGRAM MENGHITUNG RATA-RATA**\n");
    printf("================================\n");
    printf("Masukan jumlah data: \n");scanf("%d",&n);
    printf("Masukan Elemen data:\n");
    sigma = 0;
    for(i=1; i<=7; i++){
             printf("data ke-%03d: ",i); scanf ("%d",&x);
             sigma = sigma + x;
             }
    xrt=(float)sigma / n;
    printf("Total Data : %d\n",sigma);
    //menunjukan total/jumlah dari data2nya
    printf("Rata-Rata  : %f\n",xrt);
    //rata2 menunjukan nilai semua dijumlah kemudian dibagi sebanyak jumlah data
    printf("================================\n");
    printf("\n\n");
    system("pause");
    return(0);
}}   

Share

Twitter Delicious Facebook Digg Stumbleupon Favorites More