Ceriwis

Ceriwis (https://forum.ceriwis.com/forum.php)
-   Programming (https://forum.ceriwis.com/forumdisplay.php?f=63)
-   -   GAN gw salah dimana seeh nii,tolongin yaa (https://forum.ceriwis.com/showthread.php?t=538919)

Braincode 11th November 2011 02:16 PM

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


All times are GMT +7. The time now is 08:54 PM.