Is this an issue?
#4
@bobkreid - I don't understand what you want to show or prove. Do you want to show how long it takes to add two numbers in C or in Basic with a function?

So, in the two examples, probably about 0.0001 second, or something.

Code: (Select All)
//Addiert zwei Zahlen - 1. Juni 2022

#include <stdlib.h>
#include <stdio.h>

//Funktionsdeklaration
int addiere_zwei_zahlen(int zahl1, int zahl2);

int main(void)
{
    int zahl1, zahl2;
    
    printf("\nGeben Sie 2 Zahlen ein (Zahl1 <Leertaste> Zahl2\n");
    scanf("%d %d", &zahl1, &zahl2);
    
    printf("\nDie Summe ist: %d\n", addiere_zwei_zahlen(zahl1, zahl2));
    
    return(0);
}

int addiere_zwei_zahlen(int zahl1, int zahl2)
{
    return(zahl1 + zahl2);
}

Code: (Select All)
'Addition zweier Zahlen, 1. Juni 2022

Option _Explicit

Declare Function addiere(Zahl1 as Integer, Zahl2 as Integer) as Integer

Dim Zahl1 As Integer, Zahl2 As Integer

Print "Geben Sie 2 Zahlen ein: "
Input "Zahl1: ", Zahl1
Input "Zahl2: ", Zahl2

Print
Print Using "Die Summe der beiden Zahlen ist: ####"; addiere(Zahl1, Zahl2)

End

Function addiere (Zahl1 As Integer, Zahl2 As Integer)

  addiere = Zahl1 + Zahl2
End Function

The Time Machine is really a very well film (1960!).  Tongue
Reply


Messages In This Thread
Is this an issue? - by bobkreid - 07-01-2022, 07:56 PM
RE: Is this an issue? - by bplus - 07-01-2022, 11:00 PM
RE: Is this an issue? - by Kernelpanic - 07-01-2022, 11:42 PM
RE: Is this an issue? - by Kernelpanic - 07-01-2022, 11:57 PM
RE: Is this an issue? - by DSMan195276 - 07-02-2022, 12:32 AM
RE: Is this an issue? - by bobkreid - 07-03-2022, 10:27 AM
RE: Is this an issue? - by SMcNeill - 07-02-2022, 01:10 AM
RE: Is this an issue? - by bobkreid - 07-03-2022, 10:35 AM
RE: Is this an issue? - by madscijr - 07-02-2022, 09:35 PM
RE: Is this an issue? - by DSMan195276 - 07-03-2022, 05:48 AM
RE: Is this an issue? - by madscijr - 07-03-2022, 03:05 PM
RE: Is this an issue? - by DSMan195276 - 07-04-2022, 03:48 AM



Users browsing this thread: 4 Guest(s)