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 1 day ago Inaugural Lecture by Prof. Mukandala: Dola, Soko na Kushindwa kwa Taasisi View the latest post Replies 2 Views 93
- by Eli 3 days ago All in One: YouTube, TED, X, Facebook and Instagram Reels, Videos, Images and Text Posts View the latest post Replies 332 Views 42342
- by Eli 3 days ago Iran's President Ebrahim Raisi Aged 63 Dies in a Helicopter Crash View the latest post Replies 3 Views 77
- by Eli 3 days ago Re: What is in Your Mind? View the latest post Replies 717 Views 309230
- by Eli 5 days ago PySpark for Large Data Processing View the latest post Replies 2 Views 8215
- by Eli 5 days ago Online Bible View the latest post Replies 3 Views 23346
- by Eli 5 days ago Generating SSH Key and Adding it to the ssh-agent for Authentication on GitHub View the latest post Replies 1 Views 553
- by Eli 1 week ago Russia Invades Ukraine View the latest post Replies 663 Views 243189
- by Eli 2 weeks ago President Museveni's Speech During International Development Association (IDA) Summit View the latest post Replies 1 Views 513
- by Eli 2 weeks ago From Simple Linear Regression Analysis to Covariance & Correlation to Independent Determinant, and R-Squared View the latest post Replies 11 Views 25163
-
Run C, C++, Java, PHP, Python, JavaScript Codes Just from This Forum!
- Eli
- Senior Expert Member
- Reactions: 183
- Posts: 5414
- 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: 5414
- 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: 5414
- 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 2 guests