C++ for, Input data
disini anda diminta memasukkan bayaknya data yang ingin anda masukkan kemudian masukkan identitas anda, silahkan mencoba.
#include <iostream>
#include <stdlib.h>
using namespace std;
int main()
{
a:
int z;
char prodi[40],batch[40],choice(2);
cout<<"Masukkan Banyaknya Data = ";
cin>>z;
for (int x=1;x<=2;x++)
{
cout<<" ";
cin.getline(prodi,sizeof(prodi));
cout<<"STUDY PROGRAM = ";
cin.getline(prodi,sizeof(prodi));
cout<<"BATCH = ";
cin.getline(batch,sizeof(batch));
}
cout<<"\nBack To Menu [Y/N] : ";
cin>>choice;
if(choice == 'y')
{
goto a;
}
else
system("cls");
}
#include <stdlib.h>
using namespace std;
int main()
{
a:
int z;
char prodi[40],batch[40],choice(2);
cout<<"Masukkan Banyaknya Data = ";
cin>>z;
for (int x=1;x<=2;x++)
{
cout<<" ";
cin.getline(prodi,sizeof(prodi));
cout<<"STUDY PROGRAM = ";
cin.getline(prodi,sizeof(prodi));
cout<<"BATCH = ";
cin.getline(batch,sizeof(batch));
}
cout<<"\nBack To Menu [Y/N] : ";
cin>>choice;
if(choice == 'y')
{
goto a;
}
else
system("cls");
}