Simple ProgramsLet's see the simple example of printing 1 to 10 numbers using respective languages. Program in CIn this program, the value of i is 1. The "do-while" loop is used in this program to print the numbers from 1 to 10 using printf() function. Program in C++In this program, i contains the value 1. The do while loop is used to print the numbers from 1 to 10 using cout object. Program in C#In this example, i contains the value 1. The do-while loop is used in this program to print the numbers from 1 to 10 using Console.Write(). Program in JavaIn this example, i contains the value 1. The do-while loop is used in this program to print the numbers from 1 to 10 using System.out.print(). Program in JavaScriptIn this program, variable i contains the value 1. The do while loop is used in this program to print 1 to 10 numbers using document.write() funtion. Program in PerlIn this program, $i contains the value 1 and printf() function is used to print the numbers from 1 to 10. Program in PHPIn this program, $i contains the value 1 and an echo statement is used to print the values of i. Program in RubyIn this program, ruby contains "do if" block. This loop opposes the "if-condition" i.e the i>10. Therefore, the loop is executed till i=10. When, i becomes 11, control terminates the loop. Program in SwiftIn this program, variable i contains the value 1.The "repeat -while" loop is executed till i=10. When i becomes 11, it leads to the termination of a loop. Output: 1 2 3 4 5 6 7 8 9 10 C languageHI , You are in C language Factorial Program. C++ languageHI , You are in C++ language Factorial Program. JAVA languageHI , You are in JAVA language Factorial Program. Python languageHI , You are in Python language Factorial Program. Angular languageHI , You are in Angular language Factorial Program. Ruby languageHI , You are in Ruby language Factorial Program. iOS languageHI , You are in iOS language Factorial Program. Javascript languageHI , You are in Javascript language Factorial Program. C# languageHI , You are in C# language Factorial Program. Perl languageHI , You are in Perl language Factorial Program. C languageHI , You are in C language Factorial Program. C++ languageHI , You are in C++ language Factorial Program. JAVA languageHI , You are in JAVA language Factorial Program. Python languageHI , You are in Python language Factorial Program. Angular languageHI , You are in Angular language Factorial Program. Ruby languageHI , You are in Ruby language Factorial Program. iOS languageHI , You are in iOS language Factorial Program. Javascript languageHI , You are in Javascript language Factorial Program. C# languageHI , You are in C# language Factorial Program. Perl languageHI , You are in Perl language Factorial Program. |