Program Fungsi Nexted For
#include <cstdlib>
#include <iostream>
#include <iomanip>
using namespace std;
int main(int argc, char *argv[])
{
int nilai=50;
int i,j;
cout<<" Masukkan maksimal angka ";cin>>nilai;
for(i=1;i<=nilai;i++)
{
for(j=i;j<=(i)*nilai;j=j+(i))
{
cout<<setiosflags(ios::left)<<setw(5)<<j;
}
cout<<j<<endl;
}
system("PAUSE");
return EXIT_SUCCESS;
Gambar hasil program
Komentar
Posting Komentar