Learning language is easy but learning basics is difficult
Carey Brown wrote:Here you have forward slashes (correct) in one place and backwards slashes in the other.
Mohammad Ali Raisi wrote:thank you for the reply, yes you are right is forward slash "//" and actually I did not expect those condition now it will be better to consider those conditions as well, and i attached the sample file that I am using please have it and help me to solve the issue because tomorrow i have to submit my homework
package javaapplication5;
/**
*
* @author MOHAMMADALI
*/
public class Sum {
public static void main(String[] args){
int sum=0;
/*
this is the first program
*/
//sum of the number
int n = 10;// the total number going to sum
int count = 0;
//loop to sum all number
for(int i=0; i<n;i++)
{
//count ++;
sum= sum+ i;
}
System.out.println("the sum of the numbers are ="+ sum);
//it is the result
// this is /* a test1
/* this is a test // program */
}
}
public class Sum {
public static void main(String[] args){
int sum=0;
/*
this is the first program
*/
//sum of the number
System.out.println("please enter the number");
int n = 10;// the total number going to sum
int count = 0;
//loop to sum all number
for(int i=0; i<n;i++)
{
//count ++;
sum= sum+ i;
}
System.out.println("the sum of the numbers are ="+ sum);
//it is the result
}
}
Carey Brown wrote:Extracting all Java comments in every use case is a non-trivial undertaking.
Mohammad Ali Raisi wrote:thank you Mr. Carey Brown I have learned many things from your code
Don't get me started about those stupid light bulbs. |