Paper class for Pemrograman II

source code c++

a = 2
a = 4
a = 6
b = 4
b = 2
b = 0

//—————————————————
#pragma hdrstop
#include < iostream.h >
#include < conio.h >

//—————————————————
#pragma argsused
int main ( int argc, char* argv[] )
{
int a=2, b=4;
for ( int i=1; i<=6; i++ )
{
if ( i>3 )
{cout<<”b = “ << b << endl ;
b=b-2 ;
}
else
{cout<<”a = “ << a << endl ;
a=a+2 ;
}
}
getch();
return 0;
}

Iklan