Now you will be able to program in C, C++, Java, PHP, Python, JavaScript, and more! Thanks to the Techie Delight and GDB Online for their esteemed support. Select any language from the drop-down menu, write your code, and click run (or press F9) to execute it. There are two IDE that complement each other.
For best experience use, Mozilla Firefox if using desktop;
Google Chrome or Mozilla Firefox if using mobile:
-
- Active Topics
-
-
- by Eli 5 hours ago All in One: YouTube, TED, X, Facebook and Instagram Reels, Videos, Images and Text Posts View the latest post Replies 323 Views 23395
- by Eli 1 day ago Re: What is in Your Mind? View the latest post Replies 697 Views 288441
- by Eli 2 days ago Russia Invades Ukraine View the latest post Replies 655 Views 224263
- by Eli 3 days ago Collection of Greatest Christian Hymns of all Times View the latest post Replies 34 Views 57250
- by Eli 3 days ago Pondering Big Cosmology Questions Through Lectures and Dialogues View the latest post Replies 34 Views 57574
- by Eli 4 days ago Programmatically Manipulate Files: Renaming, Reading, Writing, Deleting, and Moving Files Between Folders View the latest post Replies 7 Views 6316
- by Eli 1 week ago Iran Launches Retaliatory Attack Against Israel, and Israel Retaliates by Attacking Iranian Isfahan Millitary Base View the latest post Replies 28 Views 5864
- by Eli 2 weeks ago Python Packages for Scientific Computing View the latest post Replies 8 Views 12534
- by Eli 2 weeks ago Dunia Yetu: Building Tanzania's Digital Future Together View the latest post Replies 5 Views 3344
- by Eli 3 weeks ago What is Retrieval-Augmented Generation (RAG)? View the latest post Replies 2 Views 5069
-
Run C, C++, Java, PHP, Python, JavaScript Codes Just from This Forum!
- Eli
- Senior Expert Member
- Reactions: 183
- Posts: 5362
- Joined: 9 years ago
- Location: Tanzania
- Has thanked: 75 times
- Been thanked: 88 times
- Contact:
Here is another IDE for Team collaborations powered by CP Initiative:
C++
Python 3
Try the following codes:
C:
C++:
Java:
Python:
Given the list of integers, X, write code to count how many integers are strictly larger than all the integers to their right. Exclude the last digit since it doesn’t have a number to its right. E.g. for [2,3,1] the answer should be 1 while for [12,4,4,2,2,3] the answer is 2.
In Python the code may look like (Use other languages):
C++
Python 3
Try the following codes:
C:
- #include<stdio.h>
- long factorial(int n)
- {
- if (n == 0)
- return 1;
- else
- return(n * factorial(n-1));
- }
- void main()
- {
- int number;
- long fact;
- printf("Enter a number: ");
- scanf("%d", &number);
- fact = factorial(number);
- printf("Factorial of %d is %ld\n", number, fact);
- return 0;
- }
- #include<stdio.h>
- int main()
- {
- int i,fact=1,number;
- printf("Enter a number: ");
- scanf("%d",&number);
- for(i=1;i<=number;i++){
- fact=fact*i;
- }
- printf("Factorial of %d is: %d",number,fact);
- return 0;
- }
C++:
- #include <iostream>
- using namespace std;
- int main() {
- int numbers[2][3];
- cout << "Enter 6 numbers: " << endl;
- // Storing user input in the array
- for (int i = 0; i < 2; ++i) {
- for (int j = 0; j < 3; ++j) {
- cin >> numbers[i][j];
- }
- }
- cout << "The numbers are: " << endl;
- // Printing array elements
- for (int i = 0; i < 2; ++i) {
- for (int j = 0; j < 3; ++j) {
- cout << "numbers[" << i << "][" << j << "]: " << numbers[i][j] << endl;
- }
- }
- return 0;
- }
Java:
- public class GCD {
- public static void main(String[] args) {
- int n1 = 366, n2 = 60;
- int hcf = hcf(n1, n2);
- System.out.printf("G.C.D of %d and %d is %d.", n1, n2, hcf);
- }
- public static int hcf(int n1, int n2)
- {
- if (n2 != 0)
- return hcf(n2, n1 % n2);
- else
- return n1;
- }
- }
Python:
Given the list of integers, X, write code to count how many integers are strictly larger than all the integers to their right. Exclude the last digit since it doesn’t have a number to its right. E.g. for [2,3,1] the answer should be 1 while for [12,4,4,2,2,3] the answer is 2.
In Python the code may look like (Use other languages):
- X = [7,9,5,3,2,4,5,0]
- def current_max(X):
- m = 0
- for i in X[::-1]:
- m = max(m, i)
- yield m
- N_int = sum([x>y for x,y in zip(X[-2::-1], current_max(X))])
- print(N_int)
0
TSSFL -- A Creative Journey Towards Infinite Possibilities!
- Eli
- Senior Expert Member
- Reactions: 183
- Posts: 5362
- Joined: 9 years ago
- Location: Tanzania
- Has thanked: 75 times
- Been thanked: 88 times
- Contact:
Copy and paste this template into the editor above and start learning HTML5, CSS, and JavaScript:
- <!DOCTYPE html>
- <html lang='en'>
- <head>
- <meta charset="UTF-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <!-- The above 3 meta tags must come first in the head; thereafter
- other head content may follow -->
- <title>Document</title>
- </head>
- <body>
- <h1>Hello World</h1>
- </body>
- </html>
0
TSSFL -- A Creative Journey Towards Infinite Possibilities!
- Eli
- Senior Expert Member
- Reactions: 183
- Posts: 5362
- Joined: 9 years ago
- Location: Tanzania
- Has thanked: 75 times
- Been thanked: 88 times
- Contact:
- import java.util.Date;
- public class Main {
- public static void main(String[] args) {
- byte age = 45;
- Date now = new Date();
- System.out.println(now);
- System.out.println("Hello TSSFL ODF");
- }
- }
0
TSSFL -- A Creative Journey Towards Infinite Possibilities!
-
- Similar Topics
- Replies
- Views
- Last post
-
- Information
-
Who is online
Users browsing this forum: No registered users and 3 guests