i'll take a stab at it, though i'm a java person.. #include<stdio.h> main() { for (int i = 1; i<9;){ printf(i); i*=-1; if(i<0) i-=2; else i+=2; } }
A 40 cm piece of string can be cut into eight 5 cm pieces.
390625
You can cut the string into 15 total pieces.
5 times 5 times 5
look at the print
if x%5==0 { System.out.println("@"'); }
If you refering to Object then String[] something=new String[2]; Here you have to remember that something only allocated space for 2 String object but it did not created them yet. By default Objects are intantiated to null so if you try to print the content of an array System.out.println(something[0]);//print null System.out.println(something[0].toLowerCase()); Throws NullPointerException Couple other ways to create Arrays In java String[] something=new String[]{"Me","You"}; String[] something={"Me", "You"};
All of the Java number classes have a parse[type] method, like parseInt() in Integer or parseDouble() in Double that convert Strings to primitive numbers. String s = getInput(); int var = Integer.parseInt(s);
C# 5 times, then D# 5 times, then G# 4 times, and then, depending on which part of the song, it's F on the D string 5 times or F on the C string 5 times. Happy Viva la Viding!! ;-)
That really depends on the programming language. In Java, it is sufficient to concatenate it with a String: int myNumber = 5; result = "" + myNumber; Other languages may require a special function, or method, to convert from integer to string.
To print the given sequence in Java, you can use a loop to iterate through each number and print it the corresponding number of times. Here's an example code snippet to achieve this: public class NumberSequence { public static void main(String[] args) { int[] numbers = {5, 4, 3, 2, 1}; for (int num : numbers) { for (int i = num; i >= 1; i--) { System.out.print(num); } System.out.print(" "); } } } This code will output: 55555 4444 333 22 1
5 times 3
System.out.println("2, 3, 5, 7"); There are so few you dont need to calculate it
QBASIC CODE/START... ==== ...QBASIC CODE/END.
12345 1234 123 12 1
The latest version of java is called Java 5 or Tiger.