Hello
I have request, anyone can port this code (c++) to pascal language, because for me pascal is a bit strange I dont understand fundamental syntax etc ..
thanks in Advance!Code:void drawTree() { int numTrees; cout<<"how many?\n"; cin>>numTrees; int rows = 3; int trees = numTrees-1; for(int g=0 ; g < numTrees; g++) { for(int i=0 ; i < rows ; i++) { for(int a = (rows-i)+trees ; a>1 ; a--)cout<<" "; for(int b = 0 ; b<3+(i*2) ; b++) cout<<"o"; cout<<"\n"; } ++rows; --trees; } cout<<"\ngoodbye";cout<<"\n "; }
You'll use print() instead of cout<<, the for loop syntax is pretty similar. What part is confusing? Oh, and you'll use the procedure keyword instead of void.
ok DoneI am cool
![]()
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks