Tugas Pemrograman C++ (Fungsi)

Silahkan kumpulkan tugas Anda pada bagian komentar di bawah dengan syarat sebagai berikut:

  • Nama diisi dengan NIM dan kelas Anda, contoh: C0710804015-A
  • Email diisi alamat email Anda masing-masing (harus milik sendiri dan valid)
  • Website dikosongkan saja
  • Masukkan tugas Anda pada kolom komentar dengan format seperti gambar berikut:
    cpp

Paling lambat diterima tanggal 20 Desember 2013 pukul 12.00 WIB, pengumpulan setelah tanggal dan waktu tersebut tidak akan dinilai…

Related Posts

About admin 179 Articles
AmazingLight.info Owner

75 Komentar

  1. #include "iostream.h";
    #include "conio.h";
    
    int i,j, data [7];
    int angka;
    void masuk();
    void keluar();
    
    void masuk ()
    {
    	for (i=0; i<7; i++)
    	{
    		cout << "Masukkan Angka: ";
    		cin >> angka;
    		data[i] = angka;
    	}
    	cout << endl;
    	keluar();
    }
    void keluar()
    {
    	cout << "No.  Isi  Histogram \n";
    	for (i=0; i<7; i++)
    	{
    		cout << " " << i+1 << "   " << data[i];
    		gotoxy (11, i+10);
    		for (j=1; j<=data[i]; j++)
    		{
    			cout << "*";
    		}
    		cout << endl;
    	}
    }
    main()
    {
    	masuk();
    }
    
  2. #include <stdio.h>
    
    long int faktorial(long int);
    
    main()
    {
       printf("\n===C1157201097===\n\n");
       int x;
       printf("Masukan Batas Faktorial = ");
       scanf("%d",&x);
       printf("\n");
       printf("Faktorial Adalah %ld\n",faktorial(x));
    }
       long int faktorial(long int batas)
       {
          long int hasil=1,i=1;
          for(batas;batas>=i;batas--)
          {
    	 hasil=hasil*batas;
          }
    	 return(hasil);
    }
    

    [/c]

  3. #include "iostream.h";
    #include "conio.h";
    
    int i,j, data [7];
    int angka;
    
    void masuk();
    void keluar();
    
    void masuk ()
    {
    	for (i=0; i<7; i++)
    	{
    		cout << "Masukkan Angka: ";
    		cin >> angka;
    		data[i] = angka;
    	}
    	cout << endl;
    	keluar();
    }
    void keluar()
    {
    	cout << "No.  Isi  Histogram \n";
    	for (i=0; i<7; i++)
    	{
    		cout << " " << i+1 << "   " << data[i];
    		gotoxy (11, i+10);
    		for (j=1; j<=data[i]; j++)
    		{
    			cout << "*";
    		}
    		cout << endl;
    	}
    }
    main()
    {
    	masuk();
    }
    
  4. #include "iostream.h";
    #include "conio.h";
    
    int i,j, data [7];
    int angka;
    void masuk();
    void keluar();
    
    void masuk ()
    {
    	for (i=0; i<7; i++)
    	{
    		cout << "Masukkan Angka: ";
    		cin >> angka;
    		data[i] = angka;
    	}
    	cout << endl;
    	keluar();
    }
    void keluar()
    {
    	cout << "No.  Isi  Histogram \n";
    	for (i=0; i<7; i++)
    	{
    		cout << " " << i+1 << "   " << data[i];
    		gotoxy (11, i+10);
    		for (j=1; j<=data[i]; j++)
    		{
    			cout << "*";
    		}
    		cout << endl;
    	}
    }
    main()
    {
    	masuk();
    }
    
  5. #include "iostream.h";
    
    int x, faktorial, N;
    void main()
    {
       cin >> N;
    	faktorial=1;
    	for(x=1; x<=N; x++)
    	{
    		faktorial= faktorial * x;
    	}
    
    	cout << "faktorial dari" << N << "adalah" << faktorial;
    }
    
  6. #include "iostream.h";
    #include "conio.h";
    
    int i,j, data [7];
    int angka;
    void masuk();
    void keluar();
    
    void masuk ()
    {
    	for (i=0; i<7; i++)
    	{
    		cout << "Masukkan Angka: ";
    		cin >> angka;
    		data[i] = angka;
    	}
    	cout << endl;
    	keluar();
    }
    void keluar()
    {
    	cout << "No.  Isi  Histogram \n";
    	for (i=0; i<7; i++)
    	{
    		cout << " " << i+1 << "   " << data[i];
    		gotoxy (11, i+10);
    		for (j=1; j<=data[i]; j++)
    		{
    			cout << "*";
    		}
    		cout << endl;
    	}
    }
    main()
    {
    	masuk();
    }
    
  7. #include "iostream.h";
    #include "conio.h";
    
    int i,j,angka;
    int data[7];
    void masuk();
    void keluar();
    
    void masuk ()
    {
    for (i=0; i<7; i++)
    	{
    	cout << "Masukkan Angka: ";
    	cin >> angka;
    	data[i] = angka;
    	}
    cout << endl;
    keluar();
    }
    
    void keluar()
    {
    cout << "No. Isi Histogram \n";
    	for (i=0; i<7; i++)
    	{
    	cout << " " << i << "  " << data[i];
    	gotoxy(11, i+10);
    		for (j=1; j<=data[i]; j++)
    		{
    			cout << "*";
    		}
    	cout << endl;
    	}
    }
    main()
    {
    	masuk();
    }
    
  8. #include "iostream.h";
    #include "conio.h";
    
    int i,j, data [7];
    int angka;
    void masuk();
    void keluar();
    
    void masuk ()
    {
    	for (i=0; i<7; i++)
    	{
    		cout << "Masukkan Angka: ";
    		cin >> angka;
    		data[i] = angka;
    	}
    	cout << endl;
    	keluar();
    }
    void keluar()
    {
    	cout << "No.  Isi  Histogram \n";
    	for (i=0; i<7; i++)
    	{
    		cout << " " << i+1 << "   " << data[i];
    		gotoxy (11, i+10);
    		for (j=1; j<=data[i]; j++)
    		{
    			cout << "*";
    		}
    		cout << endl;
    	}
    }
    main()
    {
    	masuk();
    }
    
  9. #include "iostream.h";
    
    int x,faktorial,N;
    void ulang();
    void faktor();
    
    void main()
    {
    ulang();
    }
    
    void ulang()
    {
     cout<<"Masukkan Angka :";
     cin>>N;
     faktorial=1;
     for(x=1;x<=N;x++)
     faktor();
     cout<<"Faktorial dari " <<N<< " adalah " <<faktorial;
    }
    
    void faktor()
    {
     faktorial=faktorial*x;
    }
    
  10. #include "iostream.h";
    #include "conio.h";
    
    int i,j, data [7];
    int angka;
    void masuk();
    void keluar();
    
    void masuk ()
    {
    	for (i=0; i<7; i++)
    	{
    		cout << "Masukkan Angka: ";
    		cin >> angka;
    		data[i] = angka;
    	}
    	cout << endl;
    	keluar();
    }
    void keluar()
    {
    	cout << "No.  Isi  Histogram \n";
    	for (i=0; i<7; i++)
    	{
    		cout << " " << i+1 << "   " << data[i];
    		gotoxy (11, i+10);
    		for (j=1; j<=data[i]; j++)
    		{
    			cout << "*";
    		}
    		cout << endl;
    	}
    }
    main()
    {
    	masuk();
    }
    
  11. #include "iostream.h";
    #include "conio.h";
    int i,j, data [7];
    int angka;
    void masuk();
    void keluar();
    void masuk ()
    {
    	for (i=0; i<7; i++)
    	{
    		cout << "Masukkan Angka: ";
    		cin >> angka;
    		data[i] = angka;
    	}
    	cout << endl;
    	keluar();
    }
    void keluar()
    {
    	cout << "No.  Isi  Histogram \n";
    	for (i=0; i<7; i++)
    	{
    		cout << " " << i+1 << "   " << data[i];
    		gotoxy (11, i+10);
    		for (j=1; j<=data[i]; j++)
    		{
    			cout << "*";
    		}
    		cout << endl;
    	}
    }
    main()
    {
    	masuk();
    }
    
  12. # include "stdio.h";
    # define SIZE 7
    
    int main ()
    {
    	int n[ SIZE ]={7};
    	int i,j,count;
    	count=0;
    	printf("\n PROGRAM UNTUK MENGGAMBARKAN HISTOGRAM \n");
    	printf("\n        NIM   : C1157201043            \n");
    	printf("\n        kelas : A                      \n");
    	printf("=======================================\n\n");
    	while (count <= 6){
    	printf("input angka ke : ",count);
    	scanf ("%d",&n[count]);
    	count = count + 1;
    }
    	printf("\n\n%s%13s%17s\n", "nomor", "angka", "Histogram");
    	for (i = 0; i <= SIZE-1; i++){
    		printf( "%7d%13d		",i+1, n[i]);
    		for ( j= 1; j<= n [i]; j++)
    		printf("*","*");
    	printf("\n");
    }
    	return 0;
    }
    
  13. [C]
    // NIM :C1157201023
    //Kelas:A (Sistem Informasi)

    # include “stdio.h”;
    # define SIZE 7

    int main ()
    {
    int n[ SIZE ]={7};
    int i,j,count;
    count=0;s
    printf(“\n PROGRAM UNTUK MENGGAMBARKAN HISTOGRAM \n”);
    printf(“\n FRANCISKUS \n\n”);
    printf(“\n C1157201023 \n\n”);
    printf(“=======================================\n\n”);
    while (count <= 6){
    printf("input angka ke : ",count+1);
    scanf ("%d",&n[count]);
    count = count + 1;
    }
    printf("\n\n%s%13s%17s\n", " no ", " angka_isi ", " Histogram ");
    for (i = 0; i <= SIZE-1; i++){
    printf("%7d%13d ",i+1, n[i]);
    for ( j= 1; j<= n [i]; j++)
    printf("*","*");
    printf("\n");
    }
    return 0;
    }
    [/C]

  14. # include "stdio.h";
    # define SIZE 7
    
    int main ()
    {
    	int n[ SIZE ]={7};
    	int i,j,count;
    	count=0;
    	printf("\n PROGRAM UNTUK MENGGAMBARKAN HISTOGRAM \n");
    	printf("\n        NIM   : C1157201049            \n");
    	printf("\n        kelas : A                      \n");
    	printf("=======================================\n\n");
    	while (count <= 6){
    	printf("input angka ke : ",count);
    	scanf ("%d",&n[count]);
    	count = count + 1;
    }
    	printf("\n\n%s%13s%17s\n", "nomor", "angka", "Histogram");
    	for (i = 0; i <= SIZE-1; i++){
    		printf( "%7d%13d		",i+1, n[i]);
    		for ( j= 1; j<= n [i]; j++)
    		printf("*","*");
    	printf("\n");
    }
    	return 0;
    }
    
  15. // NIM :C1157201023
    //Kelas:A (Sistem Informasi)
    
    # include "stdio.h";
    # define SIZE 7
    
    int main ()
    {
    	int n[ SIZE ]={7};
    	int i,j,count;
    	count=0;s
    	printf("\n PROGRAM UNTUK MENGGAMBARKAN HISTOGRAM \n");
    	printf("\n               FRANCISKUS          			  \n\n");
    	printf("\n               C1157201023           			 \n\n");
    	printf("=======================================\n\n");
    	while (count <= 6){
    	printf("input angka ke : ",count+1);
    	scanf ("%d",&n[count]);
    	count = count + 1;
    }
    	printf("\n\n%s%13s%17s\n", " no ", " angka_isi ", " Histogram ");
    	for (i = 0; i <= SIZE-1; i++){
    		printf("%7d%13d	  ",i+1, n[i]);
    		for ( j= 1; j<= n [i]; j++)
    		printf("*","*");
    	printf("\n");
    }
    	return 0;
    }
    
  16. 
    // Nama	: Didi Irawan
    // Nim	: C1157201011
    
    #include "iostream.h";
    #include "conio.h";
    
    int i,j, data [7];
    int angka;
    void masuk();
    void keluar();
    void masuk ()
    {
    	for (i=0; i<7; i++)
    	{
    		cout << "Masukkan Angka: ";
    		cin >> angka;
    		data[i] = angka;
    	}
    	cout << endl;
    	keluar();
    }
    void keluar()
    {
    	cout << "No.  Isi  Histogram \n";
    	for (i=0; i<7; i++)
    	{
    		cout << " " << i+1 << "   " << data[i];
    		gotoxy (11, i+10);
    		for (j=1; j<=data[i]; j++)
    		{
    			cout << "*";
    		}
    		cout << endl;
    	}
    }
    main()
    {
    	masuk();
    }
    
    
  17. # include “stdio.h”;
    # define SIZE 7

    int main ()
    {
    int n[ SIZE ]={7};
    int i,j,count;
    count=0;
    printf(“\n PROGRAM UNTUK MENGGAMBARKAN HISTOGRAM \n”);
    printf(“\n NAMA : HADIKUSUMA \n”);
    printf(“\n NIM : C1157201003 \n”);
    printf(“=======================================\n\n”);
    while (count <= 6){
    printf("input angka ke : ",count+1);
    scanf ("%d",&n[count]);
    count = count + 1;
    }
    printf("\n\n%s%13s%17s\n", "element", "angka", "Histogram");
    for (i = 0; i <= SIZE-1; i++){
    printf( "%6d%13d ",i+1, n[i]);
    for ( j= 1; j<= n [i]; j++)
    printf("*","*");
    printf("\n");
    }
    return 0;
    }

  18. // Tugas Fungsi
    #include "iostream.h";
    
    int x,faktorial,N;
    void ulang();
    void faktor();
    
    void main()
    {
    ulang();
     }
    
    void ulang()
     {
    	 cout<<"Masukkan Angka :";
    	 cin>>N;
    	 faktorial=1;
    	 for(x=1;x<=N;x++)
      {
    	faktor();
      }
    	cout<<"Faktorial dari " <<N<< " adalah " <<faktorial;
     }
    
      void faktor()
     {
    	faktorial=faktorial*x;
    }
    
  19. [C]
    #include “iostream.h”;
    #include “conio.h”;
    int i,j, data [7];
    int angka;
    void masuk();
    void keluar();
    void masuk ()
    {
    for (i=0; i<7; i++)
    {
    cout <> angka;
    data[i] = angka;
    }
    cout << endl;
    keluar();
    }
    void keluar()
    {
    cout << "No. Isi Histogram \n";
    for (i=0; i<7; i++)
    {
    cout << " " << i+1 << " " << data[i];
    gotoxy (11, i+10);
    for (j=1; j<=data[i]; j++)
    {
    cout << "*";
    }
    cout << endl;
    }
    }
    main()
    {
    masuk();
    }
    [/C]

  20. //CILA (C1257201046)
    
    #include <iostream.h>
    #include <iomanip.h>
    #include <conio.h>
    
    void main ()
    {
    	int i,j, angka;
    	int data[7];
    
    	for (i=0; i<7; i++)
    	{
    		cout << "Masukan angka:"; cin >> angka;
    		data[i] = angka;
    	}
    	cout<<endl;
    	cout << "No.  Isi   Histogram "<<endl;
    	for (i=0; i<7; i++)
    	{
    		cout<<setprecision(2)<<""<<i+1;
    		cout<<setprecision(8)<<"    "<<data[i]<<"     ";
    		for(j=1; j<=data[i]; j++)
    		{
    			cout<<setprecision(25)<<"*";
    		}
    		cout<<endl;
    	}
    }
    
    • //CILA (C1257201046)
      
      #include <iostream.h>
      #include <iomanip.h>
      #include <conio.h>
      
      void main ()
      {
      	int i,j, angka;
      	int data[7];
      
      	for (i=0; i<7; i++)
      	{
      		cout << "Masukan angka:"; cin >> angka;
      		data[i] = angka;
      	}
      	cout<<endl;
      	cout << "No.  Isi   Histogram "<<endl;
      	for (i=0; i<7; i++)
      	{
      		cout<<setprecision(2)<<""<<i+1;
      		cout<<setprecision(8)<<"    "<<data[i]<<"     ";
      		for(j=1; j<=data[i]; j++)
      		{
      			cout<<setprecision(25)<<"*";
      		}
      		cout<<endl;
      	}
      }
      
  21. # include "stdio.h";
    # define SIZE 7
    
    int main ()
    {
    	int n[ SIZE ]={7};
    	int i,j,count;
    	count=0;
    	printf("\n PROGRAM UNTUK MENGGAMBARKAN HISTOGRAM \n");
    	printf("\n        NIM   : C1157201028            \n");
    	printf("\n        kelas : A                      \n");
    	printf("=======================================\n\n");
    	while (count <= 6){
    	printf("input angka ke : ",count);
    	scanf ("%d",&n[count]);
    	count = count + 1;
    }
    	printf("\n\n%s%13s%17s\n", "nomor", "angka", "Histogram");
    	for (i = 0; i <= SIZE-1; i++){
    		printf( "%7d%13d		",i+1, n[i]);
    		for ( j= 1; j<= n [i]; j++)
    		printf("*","*");
    	printf("\n");
    }
    	return 0;
    }
    
  22. #include "iostream.h";
    #include "conio.h";
    
    int i,j, data [7];
    int angka;
    void masuk();
    void keluar();
    
    void masuk ()
    {
    	for (i=0; i<7; i++)
    	{
    		cout << "Masukkan Angka: ";
    		cin >> angka;
    		data[i] = angka;
    	}
    	cout << endl;
    	keluar();
    }
    void keluar()
    {
    	cout << "No.  Isi  Histogram \n";
    	for (i=0; i<7; i++)
    	{
    		cout << " " << i+1 << "   " << data[i];
    		gotoxy (11, i+10);
    		for (j=1; j<=data[i]; j++)
    		{
    			cout << "*";
    		}
    		cout << endl;
    	}
    }
    main()
    {
    	masuk();
    }
    
  23. [C]
    #include
    #include
    #include

    void main ()
    {
    int i,j, angka;
    int data[7];

    for (i=0; i<7; i++)
    {
    cout <> angka;
    data[i] = angka;
    }
    cout<<endl;
    cout << "No. Isi Histogram "<<endl;
    for (i=0; i<7; i++)
    {
    cout<<setprecision(2)<<""<<i+1;
    cout<<setprecision(8)<<" "<<data[i]<<" ";
    for(j=1; j<=data[i]; j++)
    {
    cout<<setprecision(25)<<"*";
    }
    cout<<endl;
    }
    }
    [/C]

    • [C]
      #include
      #include
      #include

      void main ()
      {
      int i,j, angka;
      int data[7];

      for (i=0; i<7; i++)
      {
      cout angka;
      data[i] = angka;
      }
      cout<<endl;
      cout << "No. Isi Histogram "<<endl;
      for (i=0; i<7; i++)
      {
      cout<<setprecision(2)<<""<<i+1;
      cout<<setprecision(8)<<" "<<data[i]<<" ";
      for(j=1; j<=data[i]; j++)
      {
      cout<<setprecision(25)<<"*";
      }
      cout<<endl;
      }
      }
      [/C]

  24. # include "stdio.h";
    # define SIZE 7
    
    int main ()
    {
    	int n[ SIZE ]={7};
    	int i,j,count;
    	count=0;
    	printf("==========================\n\n");
    	printf("\n PROGRAM TAMPIL HISTOGRAM  \n");
    	printf("\n NIM  : C1157201040 \n");
    	printf("==========================\n\n");
    	while (count <= 6){
    	printf("input angka ke : ",count+1);
    	scanf ("%d",&n[count]);
    	count = count + 1;
    }
    	printf("\n\n%s%13s%17s\n", "element", "angka", "Histogram");
    	for (i = 0; i <= SIZE-1; i++){
    		printf( "%6d%13d		",i+1, n[i]);
    		for ( j= 1; j<= n [i]; j++)
    		printf("*","*");
    	printf("\n");
    }
    	return 0;
    }
    
    
  25. # include “stdio.h”;
    # define SIZE 7

    int main ()
    {
    int n[ SIZE ]={7};
    int i,j,count;
    count=0;
    printf(“\n PROGRAM UNTUK MENGGAMBARKAN HISTOGRAM \n”);
    printf(“\NAMA : SANAS SASAN ANGELA \n”);
    printf(“\NIM : C1157201015 \n”);
    printf(“=======================================\n\n”);
    while (count <= 6){
    printf("input angka ke : ",count+1);
    scanf ("%d",&n[count]);
    count = count + 1;
    }
    printf("\n\n%s%13s%17s\n", "element", "angka", "Histogram");
    for (i = 0; i <= SIZE-1; i++){
    printf( "%6d%13d ",i+1, n[i]);
    for ( j= 1; j<= n [i]; j++)
    printf("*","*");
    printf("\n");
    }
    return 0;
    }

  26. (c)
    #include
    #include
    #include
    void main ()
    { int i,j, angka;
    int data[7];
    for (i=0; i<7; i++)
    {
    cout <> angka;
    data[i] = angka;
    }
    cout<<endl; cout << "No. Isi Histogram "<<endl;
    for (i=0; i<7; i++)
    {
    cout<<setprecision(2)<<""<<i+1;
    cout<<setprecision(8)<<" "<<data[i]<<" ";
    for(j=1; j<=data[i]; j++)
    {
    cout<<setprecision(25)<<"*";
    }
    cout<<endl;
    }

    }\

    (/C)

  27.  #include "iostream.h"; #include "conio.h"; int i,j, data [7]; int angka; void masuk(); void keluar(); void masuk () {  for (i=0; i<7; i++)  {   cout << "Masukkan Angka: ";   cin >> angka;   data[i] = angka;  }  cout << endl;  keluar(); } void keluar() {  cout << "No.  Isi  Histogram \n";  for (i=0; i<7; i++)  {   cout << " " << i+1 << "   " << data[i];   gotoxy (11, i+10);   for (j=1; j<=data[i]; j++)   {    cout << "*";   }   cout << endl;  } } main() {  masuk(); } 
  28. 
    #include "iostream.h";
    
    int x,faktorial,N;
    void ulang();
    void faktor();
    
    void main()
    {
    ulang();
    }
    
    void ulang()
     {
     cout<<"Masukkan Angka :";
     cin>>N;
     faktorial=1;
     for(x=1;x<=N;x++)
      {
    	faktor();
      }
      cout<<"faaktorial dari " <<N<< "adalah" <<faktorial;
     }
    
      void faktor()
     {
     faktorial=faktorial*x;
    }
    
  29. // NIM :C1157201026
    //Kelas:A (Sistem Informasi)
    # include "stdio.h";
    # define SIZE 7
    int main ()
    {
    	int n[ SIZE ]={7};
    	int i,j,count;
    	count=0;
    
    	printf("\n             # HISTOGRAM #               \n");
    	printf("=======================================\n\n");
    	while (count <= 6){
    	printf("input angka ke : ",count+1);
    	scanf ("%d",&n[count]);
    	count = count + 1;
    }
    	printf("\n\n%s%13s%17s\n", " no "," angka_isi "," Histogram ");
    	   for (i = 0; i <= SIZE-1; i++){
    		printf("%7d%13d	  ",i+1, n[i]);
    		for ( j= 1; j<= n [i]; j++)
    		printf("*","*");
    	printf("\n");
    }
    	return 0;
    }
    
  30. 
    
    #include "iostream.h";
    
    int x,faktorial,N;
    void ulang();
    void faktor();
    
    void main()
    {
    ulang();
    }
    
    void ulang()
     {
    cout<<"Masukkan Angka :";
    cin>>N;
    faktorial=1;
    for(x=1;x<=N;x++)
    	{
    	  faktor();
    	}
    	  cout<<"faaktorial dari " <<N<< "adalah" <<faktorial;
     }
    
      void faktor()
     {
    	  faktorial=faktorial*x;
    }
    
  31. #include <iostream.h>
    #include <iomanip.h>
    #include <conio.h>
    void main ()
    {
    	int i,j, angka;
    	int data[7];
    
    	for (i=0; i<7; i++)
    	{
    		cout << "Masukan angka:"; cin >> angka;
    		data[i] = angka;
    	}
    	cout<<endl;
    	cout << "No.  Isi   Histogram "<<endl;
    	for (i=0; i<7; i++)
    	{
    		cout<<setprecision(2)<<""<<i+1;
    		cout<<setprecision(8)<<"    "<<data[i]<<"     ";
    		for(j=1; j<=data[i]; j++)
    		{
    			cout<<setprecision(25)<<"*";
    		}
    		cout<<endl;
    	}
    }
    
    • #include <iostream.h>
      #include <iomanip.h>
      #include <conio.h>
      void main ()
      {
      	int i,j, angka;
      	int data[7];
      
      	for (i=0; i<7; i++)
      	{
      		cout << "Masukan angka:"; cin >> angka;
      		data[i] = angka;
      	}
      	cout<<endl;
      	cout << "No.  Isi   Histogram "<<endl;
      	for (i=0; i<7; i++)
      	{
      		cout<<setprecision(2)<<""<<i+1;
      		cout<<setprecision(8)<<"    "<<data[i]<<"     ";
      		for(j=1; j<=data[i]; j++)
      		{
      			cout<<setprecision(25)<<"*";
      		}
      		cout<<endl;
      	}
      }
      
  32. 
    
    #include "iostream.h";
    
    int x,faktorial,N;
    void ulang();
    void faktor();
    
    void main()
    {
    ulang();
    }
    
    void ulang()
     {
    cout<<"Masukkan Angka :";
    cin>>N;
    faktorial=1;
    for(x=1;x<=N;x++)
    	{
    	  faktor();
    	}
    	  cout<<"faaktorial dari " <<N<< "adalah" <<faktorial;
     }
    
      void faktor()
     {
    	  faktorial=faktorial*x;
    }
    
  33. #include <iostream.h> 
    #include <iomanip.h> 
    #include <conio.h> 
    void main () 
    { 
    int i,j, angka; 
    int data[7]; 
    for (i=0; i<7; i++) 
    { 
    cout << "Masukan angka:"; cin >> angka; 
    data[i] = angka; 
    } 
    cout<<endl; cout << "No. Isi Histogram "<<endl; 
    for (i=0; i<7; i++) 
    { 
    cout<<setprecision(2)<<""<<i+1;
     cout<<setprecision(8)<<" "<<data[i]<<" ";
     for(j=1; j<=data[i]; j++)
     {
     cout<<setprecision(25)<<"*"; 
    } 
    cout<<endl; 
    } 
    
    }\
    
    
    
  34. #include "iostream.h";
    
    int x,faktorial,N;
    void ulang();
    void faktor();
    
    void main()
    {
    ulang();
     }
    
    void ulang()
     {
     cout<<"Masukkan Angka :";
     cin>>N;
     faktorial=1;
     for(x=1;x<=N;x++)
     {
      faktor();
      }
      cout<<"faktorial dari " <<N<< " adalah" <<faktorial;
     }
    
     void faktor()
     {
    faktorial=faktorial*x;
    }
    
  35. #include "iostream.h";
    #include "conio.h";
    int i,j, data [7];
    int angka;
    void masuk();
    void keluar();
    void masuk ()
    {
    	for (i=0; i<7; i++)
    	{
    		cout << "Masukkan Angka: ";
    		cin >> angka;
    		data[i] = angka;
    	}
    	cout << endl;
    	keluar();
    }
    void keluar()
    {
    	cout << "No.  Isi  Histogram \n";
    	for (i=0; i<7; i++)
    	{
    		cout << " " << i+1 << "   " << data[i];
    		gotoxy (11, i+10);
    		for (j=1; j<=data[i]; j++)
    		{
    			cout << "*";
    		}
    		cout << endl;
    	}
    }
    main()
    {
    	masuk();
    }
    
  36. #include <iostream.h>
    #include <iomanip.h>
    #include <conio.h>
    
    int data[7];
    char pilih;
    void menu();
    void masukan();
    void keluaran();
    
    void menu()
    {
    	cout <<"1. Input Data"<<endl;
    	cout <<"2. Lihat Hasil"<<endl;
    	cout <<"Pilih 1/2 ? ";cin>>pilih;
    	switch(pilih)
    	{
    		case '1':masukan();break;
    		case '2':keluaran();break;
    		default:cout<<"Salah....";
    	}
    }
    	void masukan()
    	{
    		int i, angka;
    
    		for (i=0; i<7; i++)
    		{
    			cout << "Masukan angka:"; cin >> angka;
    			data[i] = angka;
    		}
    		cout << "Data yang dimasukan adalah: "<<endl;
    		for (i=0; i<7; i++)
    		{
    			cout << data[i] << " ";
    		}
    		menu();
    	}
    
    	void keluaran()
    	{
    		int i,j;
    
    		cout <<" No. Isi  Histogram\n";
    		for(i=0; i<7; i++)
    		{
    			cout<<"  "<< i+1 <<"  "<< data[i];
    			gotoxy(11,i+2);
    			for(j=1; j<=data[i]; j++)
    			{
    				cout<<"*";
    			}
    			cout<<endl;
    		}
    	}
    
    	void main()
    	{
    		menu();
    	}
    
  37. [C]

    # include “stdio.h”;
    # define SIZE 7
    int main ()
    {
    int n[ SIZE ]={7}; int i,j,count; count=0; printf(“==========================\n\n”); printf(“\n HISTOGRAM \n”);
    printf(“\n NIM : C1157201027 A \n”);
    printf(“==========================\n\n”);
    while (count <= 6)
    {
    printf("input angka ke : ",count+1);
    scanf ("%d",&n[count]);
    count = count + 1;
    }
    printf("\n\n%s%13s%17s\n", "element", "angka", "Histogram");
    for (i = 0; i <= SIZE-1; i++)
    {
    printf( "%6d%13d ",i+1, n[i]);
    for ( j= 1; j<= n [i]; j++)
    printf("*","*");
    printf("\n"); } return 0; }

    [/C]

  38. #include "iostream.h";
    #include "conio.h";
    int i,j, data [7];
    int angka;
    void masuk();
    void keluar();
    void masuk ()
    {
    	for (i=0; i<7; i++)
    	{
    		cout << "Masukkan Angka: ";
    		cin >> angka;
    		data[i] = angka;
    	}
    	cout << endl;
    	keluar();
    }
    void keluar()
    {
    	cout << "No.  Isi  Histogram \n";
    	for (i=0; i<7; i++)
    	{
    		cout << " " << i+1 << "   " << data[i];
    		gotoxy (11, i+10);
    		for (j=1; j<=data[i]; j++)
    		{
    			cout << "*";
    		}
    		cout << endl;
    	}
    }
    main()
    {
    	masuk();
    }
    
  39. [C]
    # include “stdio.h”;
    # define SIZE 7
    int main ()
    {
    int n[ SIZE ]={7}; int i,j,count; count=0;
    printf(“==========================\n\n”);
    printf(“\n HISTOGRAM \n”);
    printf(“\n NIM : C1157201027 A \n”);
    printf(“==========================\n\n”);
    while (count <= 6)
    {
    printf("input angka ke : ",count+1);
    scanf ("%d",&n[count]);
    count = count + 1;
    }
    printf("\n\n%s%13s%17s\n", "element", "angka", "Histogram");
    for (i = 0; i <= SIZE-1; i++)
    {
    printf( "%6d%13d ",i+1, n[i]);
    for ( j= 1; j<= n [i]; j++)
    printf("*","*");
    printf("\n"); } return 0; }

    [/C]

  40. #include "iostream.h";
    #include "conio.h";
    
    int i,j, data [7];
    int angka;
    void masuk();
    void keluar();
    void masuk ()
    {
    	for (i=0; i<7; i++)
    	{
    		cout << "Masukkan Angka: ";
    		cin >> angka;
    		data[i] = angka;
    	}
    	cout << endl;
    	keluar();
    }
    void keluar()
    {
    	cout << "No.  Isi  Histogram \n";
    	for (i=0; i<7; i++)
    	{
    		cout << " " << i+1 << "   " << data[i];
    		gotoxy (11, i+10);
    		for (j=1; j<=data[i]; j++)
    		{
    			cout << "*";
    		}
    		cout << endl;
    	}
    }
    main()
    {
    	masuk();
    }
    
  41. [C]
    # include “stdio.h”;
    # define SIZE 7
    int main ()
    {
    int n[ SIZE ]={7}; int i,j,count; count=0; printf(“============­==============\n\n”)­;
    printf(“\n HISTOGRAM \n”);
    printf(“\n NIM : C1157201005 A \n”);
    printf(“============­==============\n\n”)­;
    while (count <= 6)
    {
    printf("input angka ke : ",count+1);
    scanf ("%d",&n[count]);
    count = count + 1;
    }
    printf("\n\n%s%13s%1­7s\n", "element", "angka", "Histogram");
    for (i = 0; i <= SIZE-1; i++)
    {
    printf( "%6d%13d ",i+1, n[i]);
    for ( j= 1; j<= n [i]; j++)
    printf("*","*");
    printf("\n");
    }
    return 0;

    [/C]

  42. #include "iostream.h";
    #include "conio.h";
    
    int x, y, data;
    
    void output ();
    void input ();
    
    void input ()
    {
    	cout <<"masukkan data : "; cin >> i;
    	output ();
    }
    
    main () { input (); }
    
    void output ()
    {
    	cout <<"NO.  Isi Histogram \n";
    	for (x=0; x<5; x++)
    	{
    		cout << "  "<< x+1 << "   "<<data;
    		gotoxy (9, x+3);
    		for (y=1; y<=i; y++)
    	{
    cout << "*";
    }
    cout <<endl;
    }
    }
    
    • #include “iostream.h”;
      #include “conio.h”;

      int x, y, data;

      void output ();
      void input ();

      void input ()
      {
      cout <> data;
      output ();
      }

      main () { input (); }

      void output ()
      {
      cout <<"NO. Isi Histogram \n";
      for (x=0; x<5; x++)
      {
      cout << " "<< x+1 << " "<<data;
      gotoxy (9, x+3);
      for (y=1; y<=i; y++)
      {
      cout << "*";
      }
      cout <<endl;
      }
      }

    • #include "iostream.h";
      #include "conio.h";
      
      int x, y, data;
      
      void output ();
      void input ();
      
      void input ()
      {
      	cout <<"masukkan data : "; cin >> data;
      	output ();
      }
      
      main () { input (); }
      
      void output ()
      {
      	cout <<"NO.  Isi Histogram \n";
      	for (x=0; x<5; x++)
      	{
      		cout << "  "<< x+1 << "   "<<data;
      		gotoxy (9, x+3);
      		for (y=1; y<=i; y++)
      	{
      cout << "*";
      }
      cout <<endl;
      }
      }
      
  43. # include “stdio.h”;
    # define SIZE 7

    // NIM : C1157201057-A

    int main ()
    {
    int n[ SIZE ]={7};
    int i,j,count;
    count=0;
    printf(“\n PROGRAM TAMPIL HISTOGRAM \n”);
    printf(“==========================\n\n”);
    while (count <= 6){
    printf("input angka ke : ",count+1);
    scanf ("%d",&n[count]);
    count = count + 1;
    }
    printf("\n\n%s%13s%17s\n", "element", "angka", "Histogram");
    for (i = 0; i <= SIZE-1; i++){
    printf( "%6d%13d ",i+1, n[i]);
    for ( j= 1; j<= n [i]; j++)
    printf("*","*");
    printf("\n");
    }
    return 0;
    }

  44. [C]

    # include “stdio.h”;
    # define SIZE 7

    // NIM : C1157201057-A

    int main ()
    {
    int n[ SIZE ]={7};
    int i,j,count;
    count=0;
    printf(“\n PROGRAM TAMPIL HISTOGRAM \n”);
    printf(“==========================\n\n”);
    while (count <= 6){
    printf("input angka ke : ",count+1);
    scanf ("%d",&n[count]);
    count = count + 1;
    }
    printf("\n\n%s%13s%17s\n", "element", "angka", "Histogram");
    for (i = 0; i <= SIZE-1; i++){
    printf( "%6d%13d ",i+1, n[i]);
    for ( j= 1; j<= n [i]; j++)
    printf("*","*");
    printf("\n");
    }
    return 0;
    }

    [/C]

  45. # include "stdio.h";
    # define SIZE 7 
    int main () 
    { 
    int n[ SIZE ]={7}; int i,j,count; count=0; printf("==========================\n\n"); 
    printf("\n HISTOGRAM \n"); printf("\n NIM : C1157201005 A \n"); printf("==========================\n\n"); 
    while (count <= 6) 
    { 
    printf("input angka ke : ",count+1); 
    scanf ("%d",&n[count]); 
    count = count + 1; 
    } 
    printf("\n\n%s%13s%17s\n", "element", "angka", "Histogram"); 
    for (i = 0; i <= SIZE-1; i++) 
    { 
    printf( "%6d%13d ",i+1, n[i]); 
    for ( j= 1; j<= n [i]; j++) printf("*","*"); 
    printf("\n"); } return 0; 
    }
    
  46. #include "iostream.h";
    #include "conio.h";
    
    int i,j, data [7];
    int angka;
    
    void masuk();
    void keluar();
    void masuk ()
    {
    	for (i=0; i<7; i++)
    	{
    		cout << "Masukkan Angka: ";
    		cin >> angka;
    		data[i] = angka;
    	}
    	cout << endl;
    	keluar();
    }
    void keluar()
    {
    	cout << "No.  Isi  Histogram \n";
    	for (i=0; i<7; i++)
    	{
    		cout << " " << i+1 << "   " << data[i];
    		gotoxy (11, i+10);
    		for (j=1; j<=data[i]; j++)
    		{
    			cout << "*";
    		}
    		cout << endl;
    	}
    }
    main()
    {
    	masuk();
    }
    
  47. #include “iostream.h”;
    #include “conio.h”;
    int i,j, data [7];
    int angka;
    void masuk();
    void keluar();
    void masuk ()
    {
    for (i=0; i<7; i++)
    {
    cout <> angka;
    data[i] = angka;
    }
    cout << endl;
    keluar();
    }
    void keluar()
    {
    cout << "No. Isi Histogram \n";
    for (i=0; i<7; i++)
    {
    cout << " " << i+1 << " " << data[i];
    gotoxy (11, i+10);
    for (j=1; j<=data[i]; j++)
    {
    cout << "*";
    }
    cout << endl;
    }
    }
    main()
    {
    masuk();
    }
    
  48. #include <iostream.h>
    #include <iomanip.h>
    #include <conio.h>
    
    int data[7];
    char pilih;
    void menu();
    void masukan();
    void keluaran();
    
    void menu()
    {
    	cout <<"1. Input Data"<<endl;
    	cout <<"2. Lihat Hasil"<<endl;
    	cout <<"Pilih 1/2 ? ";cin>>pilih;
    	switch(pilih)
    	{
    		case '1':masukan();break;
    		case '2':keluaran();break;
    		default:cout<<"Salah....";
    	}
    }
    	void masukan()
    	{
    		int i, angka;
    
    		for (i=0; i<7; i++)
    		{
    			cout << "Masukan angka:"; cin >> angka;
    			data[i] = angka;
    		}
    		cout << "Data yang dimasukan adalah: "<<endl;
    		for (i=0; i<7; i++)
    		{
    			cout << data[i] << " ";
    		}
    		menu();
    	}
    
    	void keluaran()
    	{
    		int i,j;
    
    		cout <<" No. Isi  Histogram\n";
    		for(i=0; i<7; i++)
    		{
    			cout<<"  "<< i+1 <<"  "<< data[i];
    			gotoxy(11,i+2);
    			for(j=1; j<=data[i]; j++)
    			{
    				cout<<"*";
    			}
    			cout<<endl;
    		}
    	}
    
    	void main()
    	{
    		menu();
    	}
    
  49. #include <iostream.h>
    #include <iomanip.h>
    #include <conio.h>
    void main ()
    {
    	int i,j, angka;
    	int data[7];
    
    	for (i=0; i<7; i++)
    	{
    		cout << "Masukan angka:"; cin >> angka;
    		data[i] = angka;
    	}
    	cout<<endl;
    	cout << "No.  Isi   Histogram "<<endl;
    	for (i=0; i<7; i++)
    	{
    		cout<<setprecision(2)<<""<<i+1;
    		cout<<setprecision(8)<<"    "<<data[i]<<"     ";
    		for(j=1; j<=data[i]; j++)
    		{
    			cout<<setprecision(25)<<"*";
    		}
    		cout<<endl;
    	}
    }
    
  50. #include "iostream.h";
    #include "conio.h";
    int x, y, data;
    void output ();
    void input ();
    
    void input ()
    {
    	cout <<"masukkan data : "; cin >> data;
    	output ();
    }
    main () { input (); }
    void output ()
    {
    	cout <<"NO.  Isi Histogram \n";
    	for (x=0; x<7; x++)
    	{
    		cout << "  "<< x+1 << "   "<<data[x];
    		gotoxy (9,x+3);
    		for (y=1; y<=data; y++)
    	{
    cout << "*";
    }
    cout <<endl;
    }
    }
    
  51. #include <iostream.h>
    #include <iomanip.h>
    #include <conio.h>
    void main ()
    {
    	int i,j, angka;
    	int data[7];
    
    	for (i=0; i<7; i++)
    	{
    		cout << "Masukan angka:"; cin >> angka;
    		data[i] = angka;
    	}
    	cout<<endl;
    	cout << "No.  Isi   Histogram "<<endl;
    	for (i=0; i<7; i++)
    	{
    		cout<<setprecision(2)<<""<<i+1;
    		cout<<setprecision(8)<<"    "<<data[i]<<"     ";
    		for(j=1; j<=data[i]; j++)
    		{
    			cout<<setprecision(25)<<"*";
    		}
    		cout<<endl;
    	}
    }
    
  52. [C]

    # include “stdio.h”;
    # define SIZE 7

    int main ()
    {
    int n[ SIZE ]={7}; int i,j,count; count=0; printf(“==========================\n\n”);
    printf(“\n PROGRAM TAMPIL HISTOGRAM \n”);
    printf(“\n NIM : C1157201016 \n”);
    printf(“==========================\n\n”);
    while (count <= 6)
    {
    printf("input angka ke : ",count+1);
    scanf ("%d",&n[count]);
    count = count + 1;
    }
    printf("\n\n%s%13s%17s\n", "element", "angka", "Histogram");
    for (i = 0; i <= SIZE-1; i++)
    {
    printf( "%6d%13d ",i+1, n[i]);
    for ( j= 1; j<= n [i]; j++)
    printf("*","*");
    printf("\n");
    }
    return 0;
    }

    [/C]

  53. [C]
    # include “stdio.h”;
    # define SIZE 7

    int main ()
    {
    int n[ SIZE ]={7};
    int i,j,count;
    count=0;
    printf(“\n PROGRAM UNTUK MENGGAMBARKAN HISTOGRAM \n”);
    printf(“\n NIM : C1157201035 \n”);
    printf(“\n kelas : A \n”);
    printf(“=======================================\n\n”);
    while (count <= 6){
    printf("input angka ke : ",count);
    scanf ("%d",&n[count]);
    count = count + 1;
    }
    printf("\n\n%s%13s%17s\n", "nomor", "angka", "Histogram");
    for (i = 0; i <= SIZE-1; i++){
    printf( "%7d%13d ",i+1, n[i]);
    for ( j= 1; j<= n [i]; j++)
    printf("*","*");
    printf("\n");
    }
    return 0;
    }
    [/C]

  54. #include "iostream.h";
    #include "conio.h";
    
    int x,y;
    char data;
    
    void tampil();
    void masuk();
    
    void masuk()
    {
    	cout << "Masukan Data : ";cin >> data;
    	tampil();
    }
    
    
    void tampil()
    {
    	int x, y, data[7] ;
    	cout << "No. Isi Histogram \n";
    	for (x=0; x<7; x++)
    	{
    		cout << " " << x+1 << " " << data[x];
    		gotoxy(9, x+2);
    		for (y=1; y<=data[x]; y++)
    		{
    			cout << "*";
    		}
    		cout << endl;
    	}
    
    }
    
    main() {masuk();}
    
  55. #include "iostream.h";
    #include "conio.h";
    int i,j, data [7];
    int angka;
    void masuk();
    void keluar();
    
    
    void masuk ()
    {
    	for (i=0; i<7; i++)
    	{
    	  cout << "Masukkan Angka: ";
    	  cin >> angka;
    	  data[i] = angka;
    	}
    	  cout << endl;
    	  keluar();
            }
    
    void keluar()
    {
    	cout << "No.  Isi  Histogram \n";
    	for (i=0; i<7; i++)
    {
    	cout << " " << i+1 << "   " << data[i];
    	gotoxy (11, i+10);
    	for (j=1; j<=data[i]; j++)
    
    	{
    	  cout << "*";
    	}
    	  cout << endl;
    	}
    }
      main()
    {
      masuk();
    }
    
  56. #include <iostream.h>
    #include <iomanip.h>
    #include <conio.h>
    void main ()
    {
    	int i,j, angka;
    	int data[7];
    
    	for (i=0; i<7; i++)
    	{
    		cout << "Masukan angka:"; cin >> angka;
    		data[i] = angka;
    	}
    	cout<<endl;
    	cout << "No.  Isi   Histogram "<<endl;
    	for (i=0; i<7; i++)
    	{
    		cout<<setprecision(2)<<""<<i+1;
    		cout<<setprecision(8)<<"    "<<data[i]<<"     ";
    		for(j=1; j<=data[i]; j++)
    		{
    			cout<<setprecision(25)<<"*";
    		}
    		cout<<endl;
    	}
    }
    
  57. # include "stdio.h"; 
    #define SIZE 7 
    int main () { int n[ SIZE ]={7}; 
    int i,j,count; 
    count=0; printf("==========================\n\n"); 
    printf("\n HISTOGRAM \n"); 
    printf("\n NIM : C1157201092 C \n"); printf("==========================\n\n"); 
    while (count <= 6) { printf("input angka ke : ",count+1); 
    scanf ("%d",&n[count]); 
    count = count + 1; 
    } 
    printf("\n\n%s%13s%17s\n", "element", "angka", "Histogram"); 
    for (i = 0; i <= SIZE-1; i++) 
    { 
    printf( "%6d%13d ",i+1, n[i]); 
    for ( j= 1; j<= n [i]; j++) printf("*","*"); 
    printf("\n"); } return 0; }
    
  58. #include "iostream.h";
    #include "conio.h";
    
    int a,b,data;
    
    void output();
    void input();
    
    void input()
    {
    	cout << "Masukan Data: ";cin >> data;
    	output();
    }
    
    void output()
    {
    	cout << "No.Isi Histogram\n";
    	for (a=0; a<5; a++)
    
    cout <<"*";
    {
    cout << endl;
    }
    }
    main() {input();}
    
    • #include "iostream.h";
      #include "conio.h";
      
      int a,b,data;
      
      void output();
      void input();
      
      void input()
      {
      	cout << "Masukan Data: ";cin >> data;
      	output();
      }
      
      void output()
      {
      	cout << "No.Isi Histogram\n";
      	for (a=0; a<5; a++)
      
      cout <<"*";
      {
      cout << endl;
      }
      }
      main() {input();}
      
  59. #include "iostream.h";
    #include "conio.h";
    int angka, x, y, data;
    void menu();
    void hitung();
    
    void menu()
    {
    	cout << " Masukkan nilai angka : "; cin >> angka;
    	cout << " Masukkan nilai angka : "; cin >> angka;
    	cout << " Masukkan nilai angka : "; cin >> angka;
    	cout << " Masukkan nilai angka : "; cin >> angka;
    	cout << " Masukkan nilai angka : "; cin >> angka;
    	cout << " Masukkan nilai angka : "; cin >> angka;
    
    	hitung();
    
    }
    
    main() { menu (); }
    
    void hitung()
    {
    	cout <<"No. Isi        Histogram \n";
    	for (x = 0; x < 5; x++)
    
    	{
    		cout <<" " << x+1 << "  " << data;
    		gotoxy(22, x+8);
    		for(y=1; y<=angka; y++)
    		{
    		cout << "*";
    		}
    		cout << endl;
    		}
     }
    
    
  60. # include "stdio.h"; # define SIZE 7 int main () { int n[ SIZE ]={7}; int i,j,count; count=0; printf("==========================\n\n"); printf("\n HISTOGRAM \n"); printf("==========================\n\n"); while (count <= 6) { printf("input angka ke : ",count+1); scanf ("%d",&n[count]); count = count + 1; } printf("\n\n%s%13s%17s\n", "element", "angka", "Histogram"); for (i = 0; i <= SIZE-1; i++) { printf( "%6d%13d ",i+1, n[i]); for ( j= 1; j<= n [i]; j++) printf("*","*"); printf("\n"); } return 0; }
    
  61. # include "stdio.h"; 
    # define SIZE 7 int main () 
    { 
    int n[ SIZE ]={7}; 
    int i,j,count; 
    count=0; 
    printf("==========================\n\n"); printf("\n HISTOGRAM \n");  printf("==========================\n\n"); while (count <= 6) { printf("input angka ke : ",count+1); 
    scanf ("%d",&n[count]); 
    count = count + 1; 
    } 
    printf("\n\n%s%13s%17s\n", "element", "angka", "Histogram"); 
    for (i = 0; i <= SIZE-1; i++) 
    { 
    printf( "%6d%13d ",i+1, n[i]); for ( j= 1; j<= n [i]; j++) printf("*","*"); 
    printf("\n"); } return 0; }
    
  62. #include <iostream.h>
    #include <conio.h>
    
    int a, i;
    data();
    
    main()
    {
    	cout << "Masukan data : ";
    	cin >> a;
    	data();
    }
    data()
    {
    	int x, y;
    
    	cout << "No. Isi Histogram\n";
    	for (x=1; x<a; x++)
    	{
    		cout << " " << x << " "<< a;
    		gotoxy (9, x+2);
    		for (y=1; y<=a; y++)
    		{
    			cout << "#";
    		}
    		cout << endl;
    	}
    }
    
  63. #include <iostream.h>
    #include <conio.h>
    
    int a, i;
    data();
    
    main()
    {
    	cout << "Masukan data : ";
    	cin >> a;
    	data();
    }
    data()
    {
    	int x, y;
    
    	cout << "No. Isi Histogram\n";
    	for (x=1; x<a; x++)
    	{
    		cout << " " << x << " "<< a;
    		gotoxy (9, x+2);
    		for (y=1; y<=a; y++)
    		{
    			cout << "#";
    		}
    		cout << endl;
    	}
    }
    
    
  64. #include <iostream.h>
    
    int x,n,faktorial;
    
    viod ulang(), faktor()
    
    void main()
    {
    ulang();
    {
    faktor();
    }
    }
    void ulang()
    {
    cin>>n;
    faktorial =1;
    for(x=n; x>=1; x--);
    
    void faktor()
    faktorial = faktorial* x;
    
    cout<<"faktorial dari " <<n<<"adalah"<<faktorial;
    }
    
    
  65. #include <iostream.h>
    #include <iomanip.h>
    #include <conio.h>
    
    void main ()
    {
    	int i,j, angka;
    	int data[7];
    
    	for (i=0; i<7; i++)
    	{
    		cout << "Masukan angka:"; cin >> angka;
    		data[i] = angka;
    	}
    	cout<<endl;
    	cout << "No.  Isi   Histogram "<<endl;
    	for (i=0; i<7; i++)
    	{
    		cout<<setprecision(2)<<""<<i+1;
    		cout<<setprecision(8)<<"    "<<data[i]<<"     ";
    		for(j=1; j<=data[i]; j++)
    		{
    			cout<<setprecision(25)<<"*";
    		}
    		cout<<endl;
    	}
    }
    
  66. #include <iostream.h>
    #include <iomanip.h>
    #include <conio.h>
    
    void main ()
    {
    	int i,j, angka;
    	int data[7];
    
    	for (i=0; i<7; i++)
    	{
    		cout << "Masukan angka:"; cin >> angka;
    		data[i] = angka;
    	}
    	cout<<endl;
    	cout << "No.  Isi   Histogram "<<endl;
    	for (i=0; i<7; i++)
    	{
    		cout<<setprecision(2)<<""<<i+1;
    		cout<<setprecision(8)<<"    "<<data[i]<<"     ";
    		for(j=1; j<=data[i]; j++)
    		{
    			cout<<setprecision(25)<<"*";
    		}
    		cout<<endl;
    	}
    }
    
  67. #include <iostream.h>
    #include <iomanip.h>
    #include <conio.h>
    
    void main ()
    {
    	int i,j, angka;
    	int data[7];
    
    	for (i=0; i<7; i++)
    	{
    		cout << "Masukan angka:"; cin >> angka;
    		data[i] = angka;
    	}
    	cout<<endl;
    	cout << "No.  Isi   Histogram "<<endl;
    	for (i=0; i<7; i++)
    	{
    		cout<<setprecision(2)<<""<<i+1;
    		cout<<setprecision(8)<<"    "<<data[i]<<"     ";
    		for(j=1; j<=data[i]; j++)
    		{
    			cout<<setprecision(25)<<"*";
    		}
    		cout<<endl;
    	}
    }
    

Leave a Reply

Alamat email Anda tidak akan dipublikasikan.


*