exos programmation en langage C, Exercises of Computer Programming

A series of exercises on binary representation and ASCII code. The first exercise asks to recall how to convert from one base to another. The second exercise requires to complete a table with binary, octal, decimal, and hexadecimal representations. The third exercise asks to code some expressions in binary using the ASCII code table. The fourth exercise requires to find the expression corresponding to a given binary representation. a table with the binary representation of some ASCII characters.

Typology: Exercises

2019/2020

Available from 09/17/2023

chaymae-tahiri
chaymae-tahiri 🇲🇦

3 documents

1 / 5

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Algorithmique et Programmation 1
MIP S3 : 2019-2020
Pr. G. Mangoub
Série d’exercices N°1
EX1
1) Rappeler comment on passe de la représentation dans une base B1 à une autre base B2
2) Compléter le tableau suivant :
Binaire
Octal
Décimale
Hexadécimal
11
11
11
11
54
54
54
1
AEC
101010100010
150
55
110100010101110
1CE
409
1EFF
122
2AE
530
2FBF
EX2
1) 2AC913 = ?10
2) 2AC913 = ?16
EX3
Dans la table donnée à la fin du document, on donne
la représentation binaire de certains caractères du code ASCII.
Coder en binaire les expressions suivantes :
1) Algorithmique&Programmation
2) MIPS3_19_20
pf3
pf4
pf5

Partial preview of the text

Download exos programmation en langage C and more Exercises Computer Programming in PDF only on Docsity!

MIP S3 : 2019-

Pr. G. Mangoub

Série d’exercices N°

EX

1) Rappeler comment on passe de la représentation dans une base B1 à une autre base B 2) Compléter le tableau suivant :

Binaire Octal Décimale Hexadécimal 11 11 11 11 54 54 54 1 AEC 101010100010 150 55 110100010101110 1CE 409 1EFF 122 2AE 530 2FBF

EX

  1. 2AC9 13 =? 10
  2. 2AC9 13 =? 16

EX

Dans la table donnée à la fin du document, on donne la représentation binaire de certains caractères du code ASCII. Coder en binaire les expressions suivantes :

  1. Algorithmique&Programmation
  2. MIPS3_19_

MIP S3 : 2019-

Pr. G. Mangoub

EX

Retrouvez l’expression dont on donne la représentation en binaire : 01001000 01100101 01101100 01101100 01101111 00100001 00111111

Décimale Binaire Valeur Explication 033 00100001! exclamation mark 034 00100010 " Double quote 035 00100011 # Number sign / hash sign 036 00100100 $ Dollar sign 037 00100101 % Pourcent 038 00100110 & Ampersand 039 00100111 ' Simple quote 040 00101000 ( Left parenthesis / Opening parenthesis 041 00101001 ) Right parenthesis / Closing parenthesis 042 00101010 * Asterisk 043 00101011 + Plus 044 00101100 , Comma 045 00101101 - Minus / Dash 046 00101110. Dot 047 00101111 / Forward slash 048 00110000 0 049 00110001 1 050 00110010 2 051 00110011 3 052 00110100 4 053 00110101 5 054 00110110 6 055 00110111 7 056 00111000 8 057 00111001 9 058 00111010 : Colon 059 00111011 ; Semi-colon 060 00111100 < Less than 061 00111101 = Equal sign

MIP S3 : 2019-

Pr. G. Mangoub

098 01100010 b 099 01100011 c 100 01100100 d 101 01100101 e 102 01100110 f 103 01100111 g 104 01101000 h 105 01101001 i 106 01101010 j 107 01101011 k 108 01101100 l 109 01101101 m 110 01101110 n 111 01101111 o 112 01110000 p 113 01110001 q 114 01110010 r 115 01110011 s 116 01110100 t 117 01110101 u 118 01110110 v 119 01110111 w 120 01111000 x 121 01111001 y 122 01111010 z 123 01111011 { Left brace / Opening brace 124 01111100 | Vertical bar 125 01111101 } Right brace / Closing brace 126 01111110 ~ Tilde 127 01111111 DEL Delete

EX

Donner la représentation en binaire de -30 sur une machine de n bits

EX Effectuer les opérations suivantes :

  1. 100101 + 011011

MIP S3 : 2019-

Pr. G. Mangoub

EX7 Écrire un algorithme qui demande à l'utilisateur deux entiers X et Y (On supposera Y non nul) et qui donne le résultat de la division entière de X par Y ainsi que le reste de la division.

EX8 Traduire en C l’algorithme de l’exercice précédent.

EX9 Écrire un algorithme qui permet de calculer la surface et le volume d’un cube ouvert.

EX10 Traduire en C l’algorithme de l’exercice précédent.