Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <iostream.h>
- #include <conio.h>
- #include <math.h>
- #include <stdlib.h>
- void main()
- {
- int X=2,f=2,Y=2,w=2,key,b=2,a=2;
- int v[20];
- float G;
- cout<<"meniu:";
- cout<<"\n 1.metoda for";
- cout<<"\n 2.metoda while";
- cout<<"\n 3.metoda do";
- cout<<"\n 4.iesire";
- cout<<"\n alege metoda:";
- cin >> key;
- if((Y-(X-w)==14))
- {
- switch ( key )
- {
- case 1:
- {
- for(f=(X-w);f<Y;f++)
- {
- G=(pow(b,2)+a-f)/sqrt(abs(a+b));
- cout<<"ati ales metoda for\tG="<<G;
- }
- break;
- }
- case 2:
- {
- f=(X-w);
- {
- G=(pow(b,2)+a-f)/sqrt(abs(a+b));
- cout<<"ati ales metoda while\tG="<<G;
- f++;
- }
- break;
- }
- case 3:
- {
- f=(X-w);
- do
- {
- G=(pow(b,2)+a-f)/sqrt(abs(a+b));
- cout<<"G="<<G;
- f++;
- } while(f<Y);
- break;
- }
- case 4:
- {
- exit(0);
- }
- }
- }
- else
- {
- cout<<"\nintervalul nu se satisface";
- cout<< "\nG=" << G;
- }
- cout<<"\n\n\tPrima conditie al lucrarii practice Nr.4";
- v[20]=G;
- cout<<"\n\nv "<<G;
- cout<<"\n\n\tAdoua conditie al lucrarii practice Nr.4 \n\n";
- int Q[20] ,i ;
- randomize();
- for (i=0;i<20;i++)
- {
- cout<<" "<< Q[i];
- }
- getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement