Skip to content
Snippets Groups Projects
Commit b1009091 authored by Peter Gerwinski's avatar Peter Gerwinski
Browse files

Beispiele 26.9.2022

parent 388c2a80
Branches
No related tags found
No related merge requests found
.file "hello-01.c"
.text
.section .rodata.str1.1,"aMS",@progbits,1
.LC0:
.string "Hello, world!"
.text
.globl main
.type main, @function
main:
.LFB11:
.cfi_startproc
subq $8, %rsp
.cfi_def_cfa_offset 16
leaq .LC0(%rip), %rdi
call puts@PLT
movl $0, %eax
addq $8, %rsp
.cfi_def_cfa_offset 8
ret
.cfi_endproc
.LFE11:
.size main, .-main
.ident "GCC: (Debian 8.3.0-6) 8.3.0"
.section .note.GNU-stack,"",@progbits
#include <stdio.h>
int main (void)
{
printf ("Hello, world!\n");
return 0;
}
.file "hello-01.c"
.text
.section .rodata
.LC0:
.string "Hello, world!"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc ; .cfi_startproc
pushq %rbp ; subq $8, %rsp
.cfi_def_cfa_offset 16 ; .cfi_def_cfa_offset 16
.cfi_offset 6, -16 ; leaq .LC0(%rip), %rdi
movq %rsp, %rbp ; call puts@PLT
.cfi_def_cfa_register 6 ; movl $0, %eax
leaq .LC0(%rip), %rdi ; addq $8, %rsp
call puts@PLT ; .cfi_def_cfa_offset 8
movl $0, %eax ; ret
popq %rbp ; .cfi_endproc
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.ident "GCC: (Debian 8.3.0-6) 8.3.0"
.section .note.GNU-stack,"",@progbits
#include <stdio.h>
int main (void)
{
printf ("Hello, world!");
return 0;
}
#include <stdio.h>
int main (void)
{
printf ("Die Antwort lautet: ");
printf (42);
printf ("\n");
return 0;
}
#include <stdio.h>
int main (void)
{
printf ("Die Antwort lautet: ");
printf ("42");
printf ("\n");
return 0;
}
#include <stdio.h>
int main (void)
{
printf ("Die Antwort lautet: %d\n", 42);
return 0;
}
#include <stdio.h>
int main (void)
{
int answer = 42;
printf ("Die Antwort lautet: %d\n", answer);
return 0;
}
#include <stdio.h>
int main (void)
{
double a;
printf ("Bitte eine Zahl eingeben: ");
scanf ("%lf", &a);
printf ("Ihre Antwort war: %lf\n", a);
return 0;
}
#include <stdio.h>
int main (void)
{
double a;
printf ("Bitte eine Zahl eingeben: ");
scanf ("%lf", a);
printf ("Ihre Antwort war: %lf\n", a);
return 0;
}
#include <stdio.h>
int main (void)
{
double a;
printf ("Bitte eine Zahl eingeben: ");
scanf ("%lf", &a);
a = 2 * a;
printf ("Das Doppelte ist: %lf\n", a);
return 0;
}
#include <stdio.h>
int main (void)
{
double a = 3.14;
printf ("Das Doppelte von %lf ist: %lf\n", a, 2 * a);
return 0;
}
#include <stdio.h>
int main (void)
{
double a;
a = 3.14;
printf ("Das Doppelte von %lf ist: %lf\n", a, 2 * a);
return 0;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment