Paylaştığım soruları cevaplayabilecek olan varsa çok mutlu olurum arkadaşlar.Hayrına bir el atın lütfen
1-Write a program to estimate the summation of the given series until the any term of the series becomes greater than 1e+05. (40P) • employ do while loop for iteration structure
#include <conio.h> #include <iostream> using namespace std; int ay ( int a, int& b ); double yildiz ( double mak[ ], double y, double& x );
int i=2, j=1;
int main ( ) { int k=3, n=5, r=0, h=0; double mak[ ] = { 5, 3, 4, 0, 1, 4 }, y=3, x=3; for ( ; k<7 ; k+=2, n--, r++ ) { if (k == 5) { h = yildiz ( mak, y, x ); } else { cout<<"k "<<k<<" --h "<<h<<endl<<endl; } if ( r > 1 ) break; if ( mak[k–2] > mak[n] ) { h = mak[k–2] – 2 * mak[n]; cout<<" ++++ "<<h<<endl; } else if ( mak[k] > mak[n] ) { mak[k] = 2*mak; cout<<"mak= "<<mak[k]; } if ( k < n–1 ) continue ; cout << "\n**** "<<x<<endl<<endl ; h = ay ( k, n ); cout<<"\nn h y x "<<n<<" "<<h<<" "<<y<<" "<<x; } getch( ); return 0; }
int ay ( int y, int& x ) { x += y; cout<<"ay = "<<j<<" "<<x; return y; } double yildiz ( double mak[], double y, double& x ) { int k(2); j=2; mak[j] *= 2; x += k; y *= k; cout<<"yildiz= "<<j<<" "<<mak[j]<<" "<<x<<" "<<y<<endl; return y; }
3- Programın çıktısını ve RAM değerlerini istiyor
#include <conio.h> #include <iostream> using namespace std; void ktu ( int h[], int z, int w, int& m );
int main () { int j=3, k=2, a=3, b=2, r=2, m; int h[]={2,3,-4,1,0,2}; for ( ; ; ) { k++; if (k>3) break; h[k] = h[k-j]*b + b*j++ + --a*b++; cout << " ++++ " << h[k]<< "\n"; ktu (h,b,3,m); cout << m<< " **** " <<endl; cout <<h[3]+h[4]<< " !!!! " <<endl; ktu (h,a,r,m); h[j-a]=m; cout<<2*m<<" "<<h<<" ---- \n"; } getch(); return 0; }
void ktu ( int h[], int z, int w, int& m ) { m = ++z + w++; h[w] *= m-w; }