Results 1 to 2 of 2
- 12-07-2011, 05:03 PM #1
Member
- Join Date
- Nov 2011
- Posts
- 4
- Rep Power
- 0
how to convert from "cout" to println
The program im using doesn't accept cout so how would i fix this code
public class Lab1000
public static void main(String[]) {
#include<iostream>
using namespace std;
int F(int x)
{
return (x*x-16);
}
int main()
{
cout << " x" << " << "F(x)" << endl;
for(int i=1; i<=10; i++)
cout << x <<" "<< F(x) << endl;
return 0;
}
- 12-07-2011, 05:06 PM #2
Re: how to convert from "cout" to println
You can't just copy code from one language into another. Translate the original code into English, then translate that English into an algorithm in Java.
How to Ask Questions the Smart Way
Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!
Similar Threads
-
System.out.println("Hello Java-Forums!");
By Arsenic in forum IntroductionsReplies: 0Last Post: 03-05-2009, 05:39 PM -
MoneyOut.println("It took you (whats wrong?>",year,"<WW?) years to repay the loan")
By soc86 in forum New To JavaReplies: 2Last Post: 01-24-2009, 06:56 PM -
the dollar sign "$", prints like any other normal char in java like "a" or "*" ?
By lse123 in forum New To JavaReplies: 1Last Post: 10-20-2008, 07:35 AM -
[SOLVED] HELP! Is this BUG? System.out.println() always shows "@9304b1"
By dark_cybernetics in forum New To JavaReplies: 11Last Post: 08-19-2008, 11:29 AM


1Likes
LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks