This commit is contained in:
Emmanuel Srivastava
2024-12-02 13:59:14 +01:00
parent 851ce813f7
commit de45003c53
9 changed files with 232 additions and 0 deletions

75
DEV.1.1/.gitignore vendored Normal file
View File

@@ -0,0 +1,75 @@
# ---> C
# Prerequisites
*.d
# Object files
*.o
*.ko
*.obj
*.elf
# Linker output
*.ilk
*.map
*.exp
# Precompiled Headers
*.gch
*.pch
# Libraries
*.lib
*.a
*.la
*.lo
# Shared objects (inc. Windows DLLs)
*.dll
*.so
*.so.*
*.dylib
# Executables
*.exe
*.out
*.app
*.i*86
*.x86_64
*.hex
# Debug files
*.dSYM/
*.su
*.idb
*.pdb
# Kernel Module Compile Results
*.mod*
*.cmd
.tmp_versions/
modules.order
Module.symvers
Mkfile.old
dkms.conf
# ---> Vim
# Swap
[._]*.s[a-v][a-z]
!*.svg # comment out if you don't need vector files
[._]*.sw[a-p]
[._]s[a-rt-v][a-z]
[._]ss[a-gi-z]
[._]sw[a-p]
# Session
Session.vim
Sessionx.vim
# Temporary
.netrwhist
*~
# Auto-generated tag files
tags
# Persistent undo
[._]*.un~

View File

@@ -0,0 +1,24 @@
#include <stdio.h>
#include <stdlib.h>
int main(void){
int i,nb_elem;
int* list = NULL;
printf("Inserez la taille : ");
scanf("%d",&nb_elem);
list = (int*) malloc(nb_elem*sizeof(int));
for(i=0;i!=nb_elem;i++){
printf("inserez un entier à l'indice numéro %d : ", i);
scanf("%d",&list[i]);
}
for(i=0; i!= nb_elem; i++){
if (list[i]==list[i+1]){
printf("%d ", list[i]);
}else{
printf("");
}
}
}

10
DEV.1.1/CM1/ex1.c Normal file
View File

@@ -0,0 +1,10 @@
#include <stdio.h>
#include <stdlib.h>
int main(void){
printf(" __\n");
printf("(___()'`;\n");
printf("/, /`\n");
printf("\\\\\"--\\\\\n");
}

15
DEV.1.1/CM1/ex2.c Normal file
View File

@@ -0,0 +1,15 @@
#include <stdio.h>
#include <stdlib.h>
int main(void) {
short int a = 7;
unsigned char b = 77;
float c = 777;
long int d = 7777;
printf("%03hd\n", a);
printf("%c\n", b);
printf("%.0f\n", c);
printf("%lx\n", d);
return EXIT_SUCCESS;
}

32
DEV.1.1/CM1/ex3.c Normal file
View File

@@ -0,0 +1,32 @@
#include <stdio.h>
#include <stdlib.h>
int main(void){
int premdes, dodes;
printf("Entrez le premier dé : ");
scanf("%d", &premdes);
printf("Entrez le second dé : ");
scanf("%d", &dodes);
if(premdes!=1){
if(premdes!=6){
if(premdes==dodes){
printf("Hard ways\n");
}
}else if(premdes==6){
if(dodes==6){
printf("Boxcars");
}
}
}else if(premdes==1){
if(dodes==1){
printf("snake eyes\n");
}}
}

13
DEV.1.1/CM1/ex4.c Normal file
View File

@@ -0,0 +1,13 @@
#include <stdio.h>
#include <stdlib.h>
int main(void){
int i,j;
for(i=1;i<=20;i++){
for(j=1;j<=i;j++){
printf(" %d ",(i+j)/2);
}
}
}

18
DEV.1.1/CM1/ex4.html Normal file
View File

@@ -0,0 +1,18 @@
#include <stdio.h>
#include <stdlib.h>
int main(void){
int i,j;
for(i=1;i<=20;i++){
for(j=1;j<=i;j++){
printf(" %d ",(i+j)/2);
}
}
}htmlhrtmlhtmlhtmlhtmlhtmlhtmlhtmlhtmlhtmlhtmlhtmlhtmlhtmlhtmlhtmlhtmlh cssc cssc cscccs cs cscsc struct
{
};

26
DEV.1.1/CM1/ex5.c Normal file
View File

@@ -0,0 +1,26 @@
#include <stdio.h>
#include <stdlib.h>
#define PORTA 5
#define CROIS 4
#define aCONTORP 3
#define bCONTORP 3
#define TORP 2
int main(void){
int coord[10][10],x,y,i;
for(i=0;PORTA<0;PORTA){
coord[1][i] = 1;
}
while(coord[10][10]!= {0}){
printf("Coordonées? ");
scanf("%d %d",&x,&y);
if(coord[]==x){
if(y==)
}
}
}

19
DEV.1.1/salut.c Normal file
View File

@@ -0,0 +1,19 @@
#include <stdio.h>
#include <stdlib.h>
int main(void) {
int* p = NULL;
p = (int*) malloc(2*sizeof(int));
if (p) {
printf("Entrez un entier : ");
scanf("%d", p);
printf("Entrez un second entier : ");
scanf("%d", p + 1);
printf("Leur somme vaut %d.\n", p[0] + p[1]);
free(p);
return EXIT_SUCCESS;
} else {
puts("Espace mémoire insuffisant !");
return EXIT_FAILURE;
}
}