mercredi 4 décembre 2019

The variabel in my program is not giving the value user already gave

I am right now learning about making a program using Borland, so this is my first time on use it. I got confused by the result, cause the result is not what i expected.

In below here is my code:

#include<iostream.h>
#include<conio.h>
#include<stdio.h>
void main()
{
        char nama[25];
      char kelas[5];
      char jurusan[30];
      char universitas[30];
      char alamat[30];

      cout<<"Masukkan Nama Anda\t : ";
      gets(nama);
      cout<<endl;
      cout<<"Kelas\t\t\t : ";
      gets(kelas);
      cout<<endl;
      cout<<"Jurusan\t\t\t : ";
      gets(jurusan);
      cout<<endl;
      cout<<"Universitas\t\t : ";
      gets(universitas);
      cout<<endl;
      cout<<"Alamat\t\t\t : ";
      gets(alamat);
      cout<<endl;

      cout<<"\n\tBIODATA ANDA SEBAGAI MAHASISWA ADALAH SEBAGAI BERIKUT:"<<endl;
      cout<<"\n\nNama\t\t\t : "<<nama<<endl;
      cout<<"Kelas\t\t\t : "<<kelas<<endl;
      cout<<"Jurusan\t\t\t : "<<jurusan<<endl;
      cout<<"Universitas\t\t : "<<universitas<<endl;
      cout<<"Alamat\t\t\t : "<<alamat<<endl;
      cout<<"\n\nSilahkan tekan tombol ENTER untuk keluar dari program biodata singkat ini!";
      getch();

}

The result i got is kinda fine, but there is still one problem that i got here. Which there is one varibael that don't show what the value of the user already gave, it did not show the value, it even just gave the word "u" which i don't understand from where this word was coming. I sent it with my picture, so you guys can see it. This is the image

I hope you guys would help me, and thank you very much for reading my problem guys.

Aucun commentaire:

Enregistrer un commentaire