Ceriwis  

Go Back   Ceriwis > HOBI > Komputer & Teknologi > Programming

Programming Share, tanya jawab, saling bantu antar programmer dengan berbagai macam bahasa pemrograman.

Reply
 
Thread Tools
  #1  
Old 20th November 2011
Darkc0der Darkc0der is offline
Ceriwiser
 
Join Date: Nov 2011
Posts: 598
Rep Power: 15
Darkc0der mempunyai hidup yang Normal
Default [ask] yang salah yang mana nih gan? menghitung rata2 dlm java

program ane salahnya dmn gan? maklum,, ane nubiii:




Code:

import java.io.*;

class rata3{
public static void main(String[] args)throws IOException{
System.out.println("PROGRAM MENGHITUNG RATA-RATA DARI 3 NILAI");
System.out.println("============================== ==============");

String a;
System.out.println("Masukkan nilai ke 1 = ");
int bil=0;
a=input.readLine();
bil=Integer.parseInt(a);

String b;
System.out.println("Masukkan nilai ke 2 = ");
int bil2=0;
b=input.readLine();
bil2=Integer.parseInt(b);

String c;
System.out.println("Masukkan nilai ke 3 = ");
int bil3=0;
c=input.readLine();
bil3=Integer.parseInt(c);

int r = (bil+bil2+bil3)/3;
int j = bil+bil2+bil3;
System.out.println("============================== ==============");
System.out.println("Jumlah = "+j);
System.out.println("Rata-rata = "+r);
}
}

kok erornya ada 3 ya gan??? busett..

</div>
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Terkait
Thread Thread Starter Forum Replies Last Post
[PEDAS] Inilah gan salah satu trit yang penghuni nya rata2 Bot copas semua!! rumahmenteng Lounge 0 27th May 2012 05:39 PM
Mana yang lebih kocak = OVJ (Opera Van Java) (TRANS7) apa Segeerr Beneerr (ANTV) bakriegroup Lounge 0 27th May 2012 03:43 PM
ni salah dibagian yang mana y?/codeigniter Permenkaret Programming 0 20th November 2011 01:56 AM
[Kuis Berhadiah Melon] Tebak mana yang cewek asli dan mana yang palsu luciferz Gossip & Gallery 54 25th July 2010 12:20 PM

 


All times are GMT +7. The time now is 09:21 PM.