Write a program to calculate the following series:
Write a program to calculate the following series: S=1!+2!+3!+4!+..............................+n.
- 5692 दृश्य
- 1 उत्तर
1 उत्तर
-
-
- 01 अप्रैल
- 0 टिप्पणी
-
- Программы и игры для Андроид телефона
- Explain the difference between while loop and do-while loop.
- What is C programing? Explain your answer
- What is C language?
- What is C used for? Explain your answer
- Ищу достойного мужчину!
- What is the difference between C and C++?
- What is structured programming?
- Short circuit logical operators used in C language.
- Can someone explain the concept of pre and post increment in C?
मॉक परीक्षण अभ्यास के लिए
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 /}