Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

Compile and Execute C Online

c

#include <stdio.h>

char fakeInput[]="blablafz";

char* removeDuplicate(char str[]);

int main()
{
    //printf("Hello, World!\n");
    
    printf("RESULT: %s \n", removeDuplicate(fakeInput) );
    
    return 0;
}

char* removeDuplicate(char input[]) {
int i = 0;

// temps
int repIndex = 0;
int temp     = 0;

// crveni kvadratic
int j        = 0;
char ch;

printf("Input: %s\n",input);

while((ch = input[i++] ) != '\0') // jel trenutni element eol?
{
    
    j = i; // prije smo i++ inkrementirali, j = i da j ne gleda sam sebe
    
    printf("Looking for %c \n",ch);
    
    while(input[j] != '\0') // to je vec sljedeci element.. jel element 1 eol?
    {
        printf("Checking if %c = %c \n",input[j],ch);
        repIndex = j;
        if(ch == input[repIndex]) // b= l?n b=a?n b=b?y
        {
            printf("Yup\n");
            while(input[repIndex]!='\0')
            {
                printf("Removing %c \n",input[j]);
                temp = repIndex;
                input[temp] = input[++repIndex];
    
            }
    
        } else {
            printf("Next letter.. \n");
            j++; 
            }
    
    }
}

return input;
}

ingdanielperez_if_else_python

n = 95
s = None
if 90 <= n <= 100:
    s = "A"
elif 80 <= n < 90:
    s = "B"
elif 70 <= n < 80:
    s = "C"
elif 60 <= n < 70:
    s = "D"
else:
    s = "F"
print("Nota: {0} {1}".format(s, n))

if n>=60:
    print("Aprobado")
else:
    print("Desaprobado")

print( "Aprobado" if n >= 60 else "Desaprobado" )

Execute Python-3 Online

n = 95
s = None
if 90 <= n <= 100:
    s = "A"
elif 80 <= n < 90:
    s = "B"
elif 70 <= n < 80:
    s = "C"
elif 60 <= n < 70:
    s = "D"
else:
    s = "F"
print("Nota: {0} {1}".format(s, n))

if n>=60:
    print("Aprobado")
else:
    print("Desaprobado")

print( "Aprobado" if n >= 60 else "Desaprobado" )

Computer Science Average Exan Calculator

c

#include <iostream>
using namespace std;

int main()
{
    int n, i;
    float num[100], sum = 0.0, average;

    cout << "Enter the numbers of data: ";
    cin >> n;

    while (n > 100 || n <= 0)
    {
        cout << "Error! number should in range of (1 to 100)." << endl;
        cout << "Enter the number again: ";
        cin >> n;
    }

    for (i = 0; i < n; ++i)
    {
        cout << i + 1 << ". Enter number: ";
        cin >> num[i];
        sum += num[i];
    }

    average = sum / n;
    cout << "Average = " << average;

    return 0;
}
}

Compile and Execute Java8 Online

import java.util.*;
public class HelloWorld
{
    public static void main(String []args)
    {
        Scanner scan = new Scanner(System.in);
        System.out.println("Enter the values of a and s");
        int a = scan.nextInt();
        String s = scan.next();
        System.out.printf("%15s%d",s,a);
    }
}

algorithme python 10 de mathematique

def abonnement1(x,k):
    A=4.99+0.18*x
    B=6.99+0.083*x
    x=0
    k=1

    while B>A:
        x=x+k
        A=4.00+0.18*x
        B=6.88+0.083*x
        
    if A==B:
        print('les abonnements')
        print('ont le meme cout')
        print('pour',x, 'minutes')
        print('supplementaire de communication')
    else: 
        return(x-k)
        

Compile and Execute Verilog Online

// ------------------------- 
// Exemplo_0502
// Nome: Luiz Henrique Guimarães
// Matricula: 602076
// ------------------------- 

module AouB(a, b, Res);
    input
        a,b; //entradas bits.
    output
        Res;//Saída de a | b
    wire
        ab;
    assign ab = (~a ~& ~b);// Nand(Nand(a,b))
    assign Res = ab;//ab ~& ab;
endmodule

module main;
  reg a;
  reg b;
  wire Res;
  AouB moduloAouB (a, b, Res);
  initial 
    begin
      $display("Exemplo_0502 - Luiz Henrique Guimaraes - 602076");
      $display("   a     b    Res"); 
      $monitor("%4b  %4b  %4b", a, b, Res); 
      a = 0; b = 0;
      #1
      a = 0; b = 1;
      #1
      a = 1; b = 0;
      #1
      a = 1; b = 1;
      $finish ;
    end
endmodule

manish kumar verma mnnit allahabad

c

#include<stdio.h>
float salary(int,int);
int main()
{
	float sal;
	int i,n,hr,pr;
	char name[n];
	printf("How many letters in your name (with space) :-\n");
	scanf("%d",&n);
	printf("Enter your name:-");
	for(int i=0;i<n;i++)
	scanf("%c",&name[i]);
	printf("Enter your working hours:");
	scanf("%f",&hr);
	printf("Enter pay rate:");
	scanf("%f",&pr);
	sal=salary(hr,pr);
	for(int i=0;i<n;i++)
	printf("%c",name[i]);
	printf("\nHour:%fPayrate:%fSalary:%f",hr,pr,sal);
}
float salary(int hr,int pr)
{
	return hr*pr;
}

Compile and Execute C Online

c

#include <stdio.h>

int main()
{
    printf("Hello, World!\n");

    return 0;
}

RateSpielmitSchleifen

public class RateSpielmitSchleifen {
  
  public static void main(String[] args) {

int erlaubteVersuche = 0;
while (erlaubteVersuche < 1 || erlaubteVersuche > 8) {
  System.out.Println ("Wieviele Versuche? Zahl zwischen 1 - 8");
  erlaubteVersuche = Konsole.Read.int;
};

int zufallsZahl = (int)(Math.random() * 100) + 1; 
int versuchsZaehler = 0;

while (versuchsZaehler < erlaubteVersuche && gerateneZahl != zufallsZahl ) {
  versuchsZaehler++;
  System.out.Println("Versuch: " + versuchsZaehler);
  System.out.Println("Raten Sie mal");
  int gerateneZahl = Konsole.Read.int;
  
  if (gerateneZahl < zufallsZahl) {
      System.out.Println("Kleiner");
      }
  else if (gerateneZahl > zufallsZahl) {
    Sytstem.out.Println("Größer");
  }
  else {
        Sytstem.out.Println("<p>Glückwunsch, Sie haben die Zahl " + zufallsZahl + " korrekt erraten</p>");
      }
}

if (versuchsZaehler == erlaubteVersuche && gerateneZahl != zufallsZahl ) {
   Sytstem.out.Println("Sie haben die maximale Anzahl an Versuchen erreicht");
};

  

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.