Code Beda Hasil Sama C++

untuk menghasilkan keluaran

3 2 1
3 2
3

dalam c++ dengan menggunakan Microsoft Visual C++ 6.0 dan Borland C++ ada sedikit perbedaan penulisan code, berikut code nya :

code dengan Microsoft Visual C++ 6.0

#include <stdio.h>
#include <conio.h>
#include <iostream.h>
int main()
{
int x,y;
for(x=1; x<=3; x++)
{
for(y=4-1; y>=x; y–)
cout<<y<<” “;
cout<<“\n”;
}
return 0;
}

dan berikut code dengan menggunakan Borland C++ Builder 6

#include <stdio.h>
#include <conio.h>
#include <iostream.h>
main()
{
int x,y;
clrscr();
for(x=1; x<=3; x++)
{
for(y=4-1; y>=x;y–)
cout<<y<<” “;
printf(“\n”);
}
getch();
}

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s