Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // sol-final-ex1.cpp : Defines the entry point for the console application.
- /*
- swap main with secondary diagonal bewteen a[4][4],b[4][4] using pointer concepts in (enters , swap , print)
- */
- #include "stdafx.h"
- #include "iostream"
- using namespace std;
- int main()
- {
- float f = 0;
- float k1 = 4, k2 = 5, n, i, fact = 1, x, k3 = 2, k4=5;
- cout << "Enter Number of formula : ";
- cin >> n;
- cout << "Enter Value of X : ";
- cin >> x;
- for(i=1;i<=x;i++)
- fact = fact*i;
- for (i = 1;i <= n;i++) {
- f += k1*fact / k4*x;
- k4 = k2 - k3;
- k4 *=k4;
- k2 += 4;
- k1 = (k1 * 3) + 5;
- x = x * x;
- }
- cout << "The res : " << f << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment