Calculate the Series

visit the problem source

#include <stdio.h>
#include<conio.h>
int main ()
{
int n,i,s,p,j;
clrscr();
printf("Enter your range(n) :");
scanf("%d",&n);
p=1;
for (i=1;i<=n;i++)
{
s=0;
for (j=1;j<=i;j++)
{
s=s+i;
}
p*=s;
}
printf("\n The value of p is =%d",p);
getch();
return 0;
}

sample input/output:

input: 4
output: The value of p is =576

২টি মন্তব্য:

  1. #include
    main()
    {
    int p = 0;
    loop: ;

    printf("\n%d", p);
    p++;
    if (p<10) {
    goto loop;
    }
    getch();
    return 0;
    }

    উত্তরমুছুন
  2. #include"stdio.h"
    main(){
    int a=721;int sum=0,b,i,l;
    for(i=0;i<10;i++)
    {
    while(a>0)
    {
    b=a%5;
    a=a/5;
    printf("%i\n",l);
    printf("\n\n");
    sum+=b;
    }
    }
    printf("\nThe sum of above numbers is : %d",sum);
    }

    উত্তরমুছুন