Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <iomanip>
- /* run this program using the console pauser or add your own getch, system("pause") or input loop */
- int main(int argc, char** argv) {
- double acum1,acum2,e;
- int i;
- acum1=1;acum2=1;
- for (i=1 ; i<=7 ; i++){
- acum1=acum1*i;
- acum2=acum2+(1/acum1);
- }
- std::cout<< std::fixed <<std:: setprecision(8);
- std::cout<< acum2 << std::endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement