Write a program to calculate the following series:
Write a program to calculate the following series: S=1!+2!+3!+4!+..............................+n.
- 5696 Views
- 1 Answers
1 Answers
-
-
- 01 Apr
- 0 Comment
-
- How will you print numbers from 1 to 100 without using loop?
- Бесплатные программы
- What is the difference between C and C++?
- What are jump statements in c language?
- Mention the four important part of looping.
- Программы и игры для Андроид телефона
- C programming Program to print the Fibonacci series up to n numbers.
- What is the difference between return 0 and return 1?
- What site is the best video tutorial website for learning C programming?
- Short circuit logical operators used in C language.
Practice Mock Test
c programming
#include<stdio.h>br /int add(int num)br /{br /int i,j,fact,sum=0;br /for(i=1;i<=num;i++)//loop for finding factorial and sumbr /{br /fact=1;br /if(i!=num)br /printf("%d!+ ",i);br /elsebr /printf("%d!= ",i);br /for(j=1;j<=i;j++)br /fact=fact*j;br /sum=sum+fact;br /}br /return sum;br /}br /int main()br /{br /int num;br /printf("Enter the last number of series:\n");br /scanf("%d",&num);//last number of seriesbr /printf("%d",add(num));br /return 0;br /}