" Life is not a problem to be solved but a reality to be experienced! "
© Copyright 2013 - 2024 KUDO.TIPS - All rights reserved.
b)
#include<iostream> #include <cstdlib> using namespace std; int main(void) { int x=5,y=1,z=6; cout<<"Program realizuje algorytm przedstawiony na schemacie blokowym 3.6 "<<endl; x+=y; if(x>y+1) { x+=z; z--; } else { } if (z<3) { z*=x; } else { z*=y; z++; } cout<<"x= "<<x<<"\ny= "<<y<<"\nz= "<<z<<endl; system("Pause"); return 0; }
c)#include<iostream> #include <cstdlib> using namespace std; int main(void) { int m=5,n=4,k=0; cout<<"Program realizuje algorytm przedstawiony na schemacie blokowym 3.7 "<<endl; if(m+n<k) { cout<<"k= "<<k<<endl; } else { k=m+n; if(m+1<n) { n*=4; k--; } else { m*=2; } cout<<"m= "<<m<<"\nk= "<<k<<"\nn= "<<n<<endl; } system("Pause"); return 0; }