Posts

Showing posts with the label sum series

SUM SERIES

Image
          SUM OF SERIES         1.SUM OF SERIES 1+1/2+1/3+1....1/N        #include <stdio.h> main () { int i , n ; float sum = 0 ; printf ( "Enter value of n\n" ); scanf ( "%d" ,& n ); for ( i = 1 ; i <= n ; i ++) { sum +=( float ) 1 / i ; } printf ( "The value of\n" ); for ( i = 1 ; i <= n ; i ++) { if ( i < n ) { printf ( "1/%d+ " , i ); } else { printf ( "1/%d= " , i ); } } printf ( "%f\n" , sum ); } •Output Enter value of n 8 The value of 1/1+ 1/2+ 1/3+ 1/4+ 1/5+ 1/6+ 1/7+ 1/8= 2.717857 2.SUM OF SERIES 1/1!+1/2!+1/3!+1....+N /N! main() { int i,n; float sum=0; printf("Enter value of n\n"); scanf("%d",&n); for(i=1;i&lt;=n;i++) {  sum+=(float)i/factorial(i); } printf("The value of\n"); for(i=1;i&lt;=n;i++) {  if(i&lt;n)  {   printf("%d/%d!+ ",i,i);  }  else  {   printf("%d/%d!= ",i,i);  } } pri...

Wanna Know what is c?

Image
                     ☆INTRODUCTION  •WHAT IS C ? C is general-purpose, high level language  that was initially developed by Dennis Ritchie between 1969 and 1973  at BELL LABS . He was greatest computer scientist . It was created from “ALGOL”, “BCL”  and “B” programming languages.  'C' is a powerful programming language which is strongly associated with the UNIX operating system.    Even most of the UNIX operating system is coded in 'C'. Initially 'C' programming was limited to the UNIX operating system, but as it started spreading around the world, it became commercial, and many compilers were released for cross-platform systems.            Today 'C' runs under a variety of operating systems and hardware platforms. As it started evolving many different versions of the language were released. At times it became difficult for the developers to keep up with the latest ver...