Looking for an inspiration? Below you will find public programs submitted by other users.

Filter by: Bash C C# C++ 5.1 C++14 Haskell Java Java7 Objective-C Pascal (fpc) Pascal (gpc) Perl PHP Python Python 3 Ruby SQL VB.NET more...

#tbecl9 C 25 minutes ago
Success
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int i,n,p=2,p1,p2,count;
  5. scanf("\n %d%d",&n,&i);
  6. printf("%d",p);
  7. for(count=1;count<i;count++)
  8. {
  9. p1=2*p+1;
#9galBE C 27 minutes ago
Success
  1. #include<stdio.h>
  2. int main()
  3. {
  4. char str1[] = "Hello";
  5. char str2[] = "Fellow";
  6. if(str1[2] == str2[3])
  7. printf("Equal");
  8. else
  9. printf("Unequal");
#oWbHWW C 27 minutes ago
Success
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. // your code goes here
  5. char *p = "GATE2011";
  6. printf("%d", sizeof(p), sizeof('G'), sizeof(p[0]));
  7. printf("%s", p + p[3] - p[1]);
  8. return 0;
  9. }
#qKIYtW C++ 27 minutes ago
Success
  1. #include <iostream>
  2. int a[30][30];
  3. void spiralPrint(int n)
  4. {
  5. int i,k=0,l=0;
  6. const char z='*';
  7. int m=n;
  8. for (i=l;i<n;++i)
  9. {
#r9R1VT C++14 25 minutes ago
Success
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define sd(x) scanf("%lld",&x)
  4. int main() {
  5. unsigned long long i,temp2,t,n,a,temp,sum;
  6. // your code here
  7. sd(t);
  8. while(t--)
  9. {
#WmTpLX Python 3 26 minutes ago
Success
  1. n = int(input())
  2. if n<=1:
  3. print("You cannot generate the tree")
  4. elif n>20:
  5. print("Treee is no more")
  6. else:
  7. n1 = n+1
  8. a = n-1
  9. b = n-2
#vpVRUO C 26 minutes ago
Success
  1. #include<stdio.h>
  2. void partsf();
  3. void branches();
  4. void stand();
  5. int n;
  6. int parts;
  7.  
  8. int main()
  9. {
#axaorr Java 27 minutes ago
Success
  1. /* package whatever; // don't place package name! */
  2.  
  3. class string_demo {
  4. public static void main(String args[])
  5. {
  6. String obj = "I" + "like" + "Java";
  7. System.out.println(obj);
  8. }
  9. }
#tfv8gV C 27 minutes ago
Compilation error
  1. #include<stdio.h>
  2. #include<conio.h>
  3. void(main)
  4. {
  5. int x=10, y=15;
  6. x=x++;
  7. y=++y;
  8. printf(%d,%d”,x,y);
  9. }
#Cs5Kno C 26 minutes ago
Compilation error
  1. #include<stdio.h>
  2. int main ()
  3. {
  4. int rows,a,b,space;
  5. printf("Enter a number of rows:");
  6. scanf("%d",&rows);
  7. space=rows-1;
  8. for(b=space;b>=1;b--)
  9. {
#iCBOGg C++14 26 minutes ago
Compilation error
  1. #include <iostream>
  2. using namespace std;
  3. int top = -1; //globally defining the value of top ,as the stack is empty .
  4.  
  5. void push (int stack[ ] , int x , int n)
  6. {
  7. if ( top == n-1 ) //if top position is the last of position of stack, means stack is full .
  8. {
  9. cout << “Stack is full.Overflow condition!;
#yC9wK1 C# 27 minutes ago
Success
  1. using System;
  2.  
  3. public class Test
  4. {
  5. public static void Main()
  6. {
  7. int num1=10;
  8. int num2=20;
  9. int num3=30;
#iW2Ydd C 27 minutes ago
Runtime error
  1. #include <stdio.h>
  2. int fun(int a)
  3. {
  4. int orig = a;
  5. int count = 0;
  6. while(a>0)
  7. {
  8. a = a >> 1 << 1;
  9. if(orig-a==1)
#U9VKF2 C 27 minutes ago
Success
  1. // C code
  2. // This program will provide options for a user to calculate the square,
  3. // cube or half of a positive Integer input by a user.
  4. // Developer: Gary J Kilmer
  5. // Date: 30 July 2016
  6. #include <stdio.h>
  7. int main ()
  8. {
  9. /* variable definition: */
#UCOT35 C 27 minutes ago
Compilation error
  1. #include<stdio.h>
  2. void main(){
  3. int a=100;
  4. if(a>100)
  5. printf("M.S. Dhoni");
  6. else if(a>20)
  7. printf("M.E.K Hussey");
  8. else if(a>30)
  9. printf("A.B. de villiers");
#Krv0pd C++ 5.1 18 minutes ago
Success
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4.  
  5. bool isprime(int i){
  6.  
  7. if(i!=2 && i%2==0)
  8. return false;
  9. else if(i==2)
#5NbD5L Java 27 minutes ago
Compilation error
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
#ewoFJQ C 27 minutes ago
Success
  1. #include<stdio.h>
  2. int main()
  3. {
  4. const int *p;
  5. int a=10;
  6. p=&a;
  7. printf("%d",*p);
  8. return 0;
  9. }
#Sp4GZL C 28 minutes ago
Success
  1. #include<stdio.h>
  2. int main()
  3. {
  4. int i,l;
  5. char s[100];
  6. gets(s);
  7. for(l=0;s[l]!=0;l++);
  8. for(i=0;i<l-1;i++)
  9. {
#rNFdE8 C# 25 minutes ago
Compilation error
  1. #include <iostream.h>
  2. using namespace std;
  3. int main()
  4. {
  5. int i,space,rows,k=0;
  6. cin>>rows;
  7. int temp=rows+1;
  8. for(i=1;i<=temp;++i)
  9. {
#XywYHR C 28 minutes ago
Success
  1. #include<stdio.h>
  2. int main()
  3. {
  4. char str1[] = "Hello";
  5. char str2[] = "Fellow";
  6. if(str1[2] == str2[3])
  7. printf("Equal");
  8. else
  9. printf("Unequal");
#MYEQgj C 28 minutes ago
Success
  1. #include <stdio.h>
  2. int main(){
  3. int marks[3],i,n,sum=0;
  4. printf("Enter number of students: ");
  5. scanf("%d",&n);
  6. for(i=0;i<n;++i){
  7. printf("Enter marks of student%d: ",i+1);
  8. scanf("%d",&marks[i]);
  9. sum+=marks[i];
#VnN9CQ C 28 minutes ago
Success
  1. #include<stdio.h>
  2. int main()
  3. {
  4. int a=2,b=6,c;
  5. c = a/b;
  6. printf("%d",c);
  7. return 0;
  8. }
#Qfos6n Java 21 minutes ago
Compilation error
  1. #include<stdio.h>
  2. int main()
  3. {
  4. int rows,starNo,spaceNo;
  5. printf("enter rows:\n");
  6. scanf("%d",&rows);
  7. for(int i=1;i<=rows;i++)
  8. {
  9. starNo=i*2-1;
#es6VQD C++ 4.3.2 28 minutes ago
Success
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int countEvenSetBits(int n)
  5. {
  6. unsigned int count = 0;
  7. while (n)
  8. {
  9. n &= (n-1) ;
#k8Qccb Java 28 minutes ago
Compilation error
  1. package abc; public class Animal {
  2. public Animal() {
  3.  
  4. System.out.println("inside animal's constructor");
  5. }
  6. public void printName(){ System.out.println("Animal");
  7. }
  8. } package exam; import abc.Animal;
  9. public class Cat extends Animal{
#5xKQ0j C 28 minutes ago
Compilation error
  1. #include <stdio.h>
  2. #include <conio.h>
  3. main()
  4. {
  5. int n,p,i,j;
  6. scanf("%d",&n);
  7. p=n-1;
  8. if(n>3)
  9. {
#1qGTKu Java 28 minutes ago
Success
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
#2eARNf C 28 minutes ago
Compilation error
  1. #include<stdio.h>
  2. void partsf();
  3. void branches();
  4. void stand();
  5. int n;
  6. int parts;
  7.  
  8. int main()
  9. {
#S3cXyp C 28 minutes ago
Runtime error
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. // your code goes here
  5. int x;
  6. printf("Enter input:");
  7. scanf("%d",&x);
  8. printf(x);
  9. return 0;