1 / 9

FUNGSI

FUNGSI. #include < stdio.h> #include <conio.h> // deklarasi fungsi buatan int kuadrat( int z ) ; void garis( void ) ; void jumlah( void ); void pnilai( int x) ; void pvar( int *x ) ; Int d ; // varibel global. Void main() { int a,b ; garis() ; puts(“bahasa C”); garis() ;

ganya
Télécharger la présentation

FUNGSI

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. FUNGSI

  2. #include < stdio.h> #include <conio.h> // deklarasi fungsi buatan int kuadrat( int z ) ; void garis( void ) ; void jumlah( void ); void pnilai( int x) ; void pvar( int *x ) ; Int d ; // varibel global

  3. Void main() • { • int a,b ; • garis() ; • puts(“bahasa C”); • garis() ; • printf(“\n pangkat 2 %d”,kuadrat(2) ); • d = 10; • jumlah();

  4. a = 10; • printf(“\n a awal = %d”,a); • pnilai( a ) ; • printf(“\n a akhir = %d”,a); • b = 10; • printf(“\n b awal = %d”,b); • pvar( *b ) ; • printf(“\n b akhir = %d”,b); • } // end main

  5. Int kuadrat( int z ) { return( z * Z ); }

  6. void garis(void) { int j; // variabel lokal for ( j=1 ; j<=10 ; j++ ) printf(“=“); printf(“\n”); }

  7. void jumlah( void ) { d+=10; // d = variabel global printf(“\n d dalam jumlah %d“,d); }

  8. void pnilai( int x ) { x += 10; } //fungsi dg parameter nilai

  9. void pvar( int *x ) { *x += 10; } //fungsi dg parameter variabel

More Related