A and B or not C

bill1991 Messages postés 3 Date d'inscription   Statut Membre Dernière intervention   -  
 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.
A voir également:

1 réponse

mohamedgb007
 
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.
0
mohamedgb007
 
boucle
while
0
mias A4
 
pfffffffffffffff
0
karl legrand
 
program table;
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.
0