Commit 476a54a6 authored by Uwe Wienkop's avatar Uwe Wienkop


parent a4a072de
......@@ -14,18 +14,27 @@ namespace _03Funktionen
double a = 3, b = 4;
int c = Quersumme(12345);
int x = 10;
int xy = Quadriere(x);
static int Quadriere(int x)
// int Quadriere --> Quadriere liefert ein int-Ergebnis
// int v --> Eingangsparameter, hier vom Typ int
// int x --> Eingangsparameter, hier vom Typ int
// für x wird in der Funktion eine neue, eigene Var. angelegt
// --> Es wird eine Wertekopie an die Funktion übergeben
// D.h. Es wird der Wert der Var. x aus main genommen (also 100)
// und dieser Wert wird an die Funktion übergeben
// --> call-by-value (Wertübergabe)
return x*x;
// return liefert das Ergebnis zurück
x= x*x;
return x;
// return liefert das Ergebnis (Den Wert des Ergebnisses) zurück
static int Quersumme(int zahl)
{ // zahl ist auch hier eine neue, eigene Variable
int qs = 0;
while (zahl != 0)
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<None Include="App.config" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
<Target Name="AfterBuild">
\ No newline at end of file
<?xml version="1.0" encoding="utf-8" ?>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace _04Zufallszahlen
class Program
static void Main(string[] args)
int zahl;
Random zufall = new Random();
for (int i = 0; i < 80000; i++)
zahl = zufall.Next(0,37);
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("04Zufallszahlen")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("04Zufallszahlen")]
[assembly: AssemblyCopyright("Copyright © 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("1f63bc1e-836b-4d67-afb4-309f2bf8ce20")]
// Version information for an assembly consists of the following four values:
// Major Version
// Minor Version
// Build Number
// Revision
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("")]
[assembly: AssemblyFileVersion("")]
......@@ -36,6 +36,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "03Funktionen", "03Funktione
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "03Zahlengeneratoren2", "03Zahlengeneratoren2\03Zahlengeneratoren2.csproj", "{3950D841-D361-423D-BD33-B02BAF47DE8F}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "04Zufallszahlen", "04Zufallszahlen\04Zufallszahlen.csproj", "{1F63BC1E-836B-4D67-AFB4-309F2BF8CE20}"
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
......@@ -98,6 +100,10 @@ Global
{3950D841-D361-423D-BD33-B02BAF47DE8F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3950D841-D361-423D-BD33-B02BAF47DE8F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3950D841-D361-423D-BD33-B02BAF47DE8F}.Release|Any CPU.Build.0 = Release|Any CPU
{1F63BC1E-836B-4D67-AFB4-309F2BF8CE20}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1F63BC1E-836B-4D67-AFB4-309F2BF8CE20}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1F63BC1E-836B-4D67-AFB4-309F2BF8CE20}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1F63BC1E-836B-4D67-AFB4-309F2BF8CE20}.Release|Any CPU.Build.0 = Release|Any CPU
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment