A and B or not C
bill1991
Messages postés
3
Date d'inscription
Statut
Membre
Dernière intervention
-
karl legrand -
karl legrand -
Bonjour,
c j ai une expression
A and B or not C
ET ON ME DEMANDE DE FAIRE LE PROGRAMME QUI AFFICHE LA VALEUR DE CETTE EXPRESSION AVEC DES AFFECTATION SIMPLE JE L AI TROUVER ET J AI TROUVE 8 CAS ET JE L AI FAIS AUSSI AVEC LA BOUCLE FOR SA MA DONNER LE PROGRAMME SUIVANT:
program table;
var A,B,C:boolean ;
begin
writeln(' A B C A and B or not C ');
for A:=false to true do
for B:=false to true do
for C:=false to true do
writeln (A,B,C,A and B or not C );
readln;
end.
maintenant mon vrai probleme c est de transformer ce programme en utilisant des boucles while.
c j ai une expression
A and B or not C
ET ON ME DEMANDE DE FAIRE LE PROGRAMME QUI AFFICHE LA VALEUR DE CETTE EXPRESSION AVEC DES AFFECTATION SIMPLE JE L AI TROUVER ET J AI TROUVE 8 CAS ET JE L AI FAIS AUSSI AVEC LA BOUCLE FOR SA MA DONNER LE PROGRAMME SUIVANT:
program table;
var A,B,C:boolean ;
begin
writeln(' A B C A and B or not C ');
for A:=false to true do
for B:=false to true do
for C:=false to true do
writeln (A,B,C,A and B or not C );
readln;
end.
maintenant mon vrai probleme c est de transformer ce programme en utilisant des boucles while.
A voir également:
- A and B or not C
- Or - Guide
- Spybot search and destroy - Télécharger - Antivirus & Antimalwares
- Find and mount - Télécharger - Récupération de données
- Reboot and select proper boot device or insert boot media in selected boot device and press a key ✓ - Forum PC portable
- Fast and furious torrent magnet ✓ - Forum Téléchargement
1 réponse
program mohamedmiasA9;
uses crt;
var a,b,c,t,f :boolean;
i,j,k:integer;
begin
t:=true; f:=false;
a:=true;
i:=1;
while i<3 do begin
if i=2 then a:=f;
j:=1;b:=t;
while j<3 do begin
if j=2 then b:=f;
k:=1;b:=t;
while k<3 do begin
if k=2 then c:=f;
writeln( 'msaid A 9','a=',a,' b=',b,' c=',c,'a and b or not c',a and b or not c);
k:=k+1;
end;
j:=j+1;
end;
i:=i+1;
end;
readln;
end.
edit : mail.
uses crt;
var a,b,c,t,f :boolean;
i,j,k:integer;
begin
t:=true; f:=false;
a:=true;
i:=1;
while i<3 do begin
if i=2 then a:=f;
j:=1;b:=t;
while j<3 do begin
if j=2 then b:=f;
k:=1;b:=t;
while k<3 do begin
if k=2 then c:=f;
writeln( 'msaid A 9','a=',a,' b=',b,' c=',c,'a and b or not c',a and b or not c);
k:=k+1;
end;
j:=j+1;
end;
i:=i+1;
end;
readln;
end.
edit : mail.
while
var A,B,C:boolean ;
begin
writeln(' A B C A and B or not C ');
A:=false;
while A<true do begin
B:=false ;
while b< true do begin
C:=false ;
while c<true do begin
writeln (A,B,C,A and B or not C );
c:=succ(c);
end; // while c
b:=succ(b);
end; // while b
a:=succ(a);
end; // while a
readln;
end.