ajout exemples de code cm2
This commit is contained in:
12
cm2-nombres-code/char.c
Normal file
12
cm2-nombres-code/char.c
Normal file
@ -0,0 +1,12 @@
|
||||
#include <stdio.h>
|
||||
|
||||
void main()
|
||||
{
|
||||
unsigned char a = 155;
|
||||
unsigned char b = 155;
|
||||
unsigned char c = a + b;
|
||||
|
||||
printf("Value of c is: %d\n",c);
|
||||
|
||||
|
||||
}
|
12
cm2-nombres-code/char2.c
Normal file
12
cm2-nombres-code/char2.c
Normal file
@ -0,0 +1,12 @@
|
||||
#include <stdio.h>
|
||||
|
||||
void main()
|
||||
{
|
||||
char a = 127;
|
||||
char b = 1;
|
||||
char c = a + b;
|
||||
|
||||
printf("Value of c is: %d\n",c);
|
||||
|
||||
|
||||
}
|
11
cm2-nombres-code/double.c
Normal file
11
cm2-nombres-code/double.c
Normal file
@ -0,0 +1,11 @@
|
||||
#include <stdio.h>
|
||||
|
||||
void main()
|
||||
{
|
||||
double a = 0.1;
|
||||
double b = 0.2;
|
||||
double c = a + b;
|
||||
|
||||
printf("Value of c is: %.20f\n",c);
|
||||
|
||||
}
|
11
cm2-nombres-code/int.c
Normal file
11
cm2-nombres-code/int.c
Normal file
@ -0,0 +1,11 @@
|
||||
#include <stdio.h>
|
||||
|
||||
void main()
|
||||
{
|
||||
int a = 0.1;
|
||||
int b = 0.2;
|
||||
int c = a + b;
|
||||
|
||||
printf("Value of c is: %d\n",c);
|
||||
|
||||
}
|
Reference in New Issue
Block a user