Membuat Looping Minus -[Visual C++]-
Source Code Looping Minus :
#include<iostream.h>
int main()
{
int n,i;
cout<<"\t-[ Arif Syarifuddin ]-"<<endl;
cout<<"\t-[ TI111004 ]-"<<endl;
cout<<"\t-[ Politeknik TEDC Bandung ]-"<<endl;
cout<<"\t-[ **Looping Minus** ]-"<<endl<<endl<<endl;
cout<<"Masukkan Angka Yang Anda Inginkan= ";
cin>>n;
for(i=1;i<=n;i++)
{
if(i%2==0)
{cout<<" "<<i*-1;}
else cout<<" "<<i;
}
}
Tidak ada komentar:
Posting Komentar