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 11th November 2011
Braincode's Avatar
Braincode Braincode is offline
Ceriwis Addicted
 
Join Date: Nov 2011
Posts: 4,638
Rep Power: 20
Braincode mempunyai hidup yang Normal
Default GAN gw salah dimana seeh nii,tolongin yaa

Prima nyaa ga bisa keluar gan,,salaahdimana yaa gw,,bantuin dong sob



#include "stdio.h"

#include "conio.h"



int n,pil,err=0;





int prima(int n)

void main()

{

void garis();

int fibo(int n);

long int fakto(int x);

void menu();

menu();

}

void menu()

{

void garis();

int fibo(int n);

long int fakto(int x);

clrscr();

garis();

gotoxy(25,2);printf("+-------------------+\n");

gotoxy(25,3);printf("| ++++ MENU ++++ |\n");

gotoxy(25,4);printf("+-------------------+\n");

gotoxy(25,5);printf("| 1 | Fibonacci |\n");

gotoxy(25,6);printf("| 2 | Prima |\n");

gotoxy(25,7);printf("| 3 | Exit |\n");

gotoxy(25,8);printf("+-------------------+\n");

gotoxy(25,9);printf("| Pilih : |\n");

gotoxy(25,10);printf("+-------------------+\n");

gotoxy(36,9);scanf("%d",&pil);

switch(pil)

{

case 1:

{

clrscr();

printf("\nMasukan Batas Bilangan Fibonacci : ");

scanf("%d",&n);

fibo(n);

menu();

break;

}

case 2:

{

clrscr();

printf("\Masukan Batas Bilangan Prima : ");

scanf("%d",&n);

prima(n);



menu();

break;

}

case 3:exit();

default:

{

clrscr();

err=err+1;

if(err>=3)

{

gotoxy(25,20);printf("\n\tUdah dibilang salah juga nih orang\n\tUdah sono lu pergi!!!");

getch();

exit();

}

else

gotoxy(25,20);{printf("\n\tApa-apaan ini pilihannya salah boss!!");}

getch();

menu();

break;

}

}

getch();

}



void garis()

{ gotoxy(18,1);printf("+++++++ PROGRAM FIBO & PRIMA +++++++\n\n");}



int fibo(int n)

{

int i;

int a=0,b=1;

int temp;

printf("Bilangan Fibonacci dari 0 - %d : ",n);

for(i=0;i

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


 


All times are GMT +7. The time now is 10:57 PM.


no new posts