package coffee; public class Program { public static void main(String[] args) { String words = "Java"; char[] chars = words.toCharArray(); for (char t : chars) { // Java 10: for (var t : chars) System.out.println(t); } }} /* OutputJava*/ package coffee; public class Program { public static void main(String[] args) { String words = "Java"; for (int i = 0; i < words.length(); i++) { System.out.pri..
package coffee; public class Program { public static void main(String[] args) { for (int i = 0; i < 4; i++) { System.out.println(i); } }} /* Output0123*/ package coffee; public class Program { public static void main(String[] args) { int[] arr = {0, 1, 2, 3}; for (int i : arr) { System.out.println(i); } }} /* Output0123*/
using System;using System.Collections.Generic; namespace Console1{ class Program { static void Main(string[] args) { List animals = new List(); animals.Add("cat"); animals.Add("dog"); animals.Add("fox"); foreach (string animal in animals) { Console.WriteLine(animal); } } }} /* Outputcatdogfox*/ using System;using System.Collections.Generic; namespace Console1{ class Program { static void Main(st..
using System; namespace Console1{ class Program { static void Main(string[] args) { string words = "Hello"; foreach (var c in words) { Console.WriteLine(c); } } }} /* OutputHello*/ using System; namespace Console1{ class Program { static void Main(string[] args) { string words = "Hello"; for (int i = 0; i < words.Length; i++) { Console.WriteLine(words[i]); } } }} /* OutputHello*/
using System; namespace Console1{ class Program { static void Main(string[] args) { for (int i = 0; i < 4; i++) { Console.WriteLine(i); } } }} /* Output0123*/ using System; namespace Console1{ class Program { static void Main(string[] args) { int[] arr = { 0, 1, 2, 3 }; foreach (int i in arr) { Console.WriteLine(i); } } }} /* Output0123*/
# Python 3 words = 'Python' for c in words: print(c) """ OutputPython""" # Python 3 words = 'Python' for i in range(len(words)): print(i, words[i]) """ Output0 P1 y2 t3 h4 o5 n""" # Python 3 words = 'Python' for i, c in enumerate(words): print(i, c) """ Output0 P1 y2 t3 h4 o5 n"""
Windows Dev CenterDevelop Windows desktop applicationsGet started - New to application development?Desktop ProgrammingLearn to Program for Windows in C++Module 1. Your First Windows ProgramClosing the Window