1 / 6

Flux del programa i II

Flux del programa i II. si. no. Funciona?. no. si. Ho has tocat?. imbècil. No ho toquis !!. Ho sap algú?. no. si. no. si. Tindràs Problemes ?. Passa del tema. Pobre tonto !!. Amaga-ho. Pots culpar a algú?. no. si. CAP PROBLEMA !!. Projecte9.11-if else. inici.

novia
Télécharger la présentation

Flux del programa i II

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Flux del programa i II

  2. si no Funciona? no si Ho has tocat? imbècil No ho toquis !! Ho sap algú? no si no si Tindràs Problemes ? Passa del tema Pobre tonto !! Amaga-ho Pots culpar a algú? no si CAP PROBLEMA !!

  3. Projecte9.11-if else inici Entrem el valor del número Es carrega el valor del número a la variable. a>0 si no cout<<“negatiu”; cout<<“positiu”; #include <iostream.h> #include <conio.h> void main (void) { int a; cout<<"diguem un numero et diré si es positiu o negatiu: "; cin>>x; if (a>0) cout<<"es positiu!"; else cout<<"es negatiu!"; getch(); }

  4. Projecte9.12 només if inici Entrem el valor del número Es carrega el valors del número a la variables. a<0 a>0 si si cout<<“positiu”; cout<<“negatiu”; #include <iostream.h> #include <conio.h> void main (void) { int a; cout<<"diguem un numero et diré si es positiu o negatiu: "; cin>>x; if (a>0) cout<<"es positiu!"; if (a<0) cout<<"es negatiu!"; getch(); }

  5. + Projectes ++ inici Entrem el valor de dos números Es carrega el valors dels números a la variables. si a>b no si cout<<“decreixent”; a<b cout<<“son iguals”; cout<<“creixent”; #include <iostream.h> #include <conio.h> int a,b; void main(void) { cout<<" Entra el primer numero"; cin>>a; cout<<" Entra el segon"; cin>>b; if(a>b) cout<<"ORDRE DECREIXENT"; else if(a<b) cout<<"ORDRE CREIXENT"; else cout<<"son iguals"; getch(); }

  6. + Projectes ++ enniuats determina de 3 números quin és més petit inici #include <iostream.h> #include <conio.h> int main() { int a,b,c,menor; cout<< "entra un numero " ; cin>>a ; cout<< "entra un altre numero " ; cin>>b ; cout<< "entra el tercer numero " ; cin>>c ; if (a < b) { if (a < c) menor = a; else menor = c; } else { if (b < c) menor = b; else menor = c; } cout<< "el més petit es el "<<menor; cout<<" \n FI DEL PROGRAMA"; getch(); } Entrem el valor de tres números Es carrega el valors dels números a les variables. a<b si no a<c no si b<c no si menor=a menor=c menor=b menor=c Es podria fer aixi i de dues maneres més...

More Related