C Program to find factorial of a numberSimple C Programint main() {int n,i,f=1;printf("enter any num \n");scanf("%d",&n);for(i=1;i
ITS EASY...TRY THIS OUT..TRAPEZOIDAL METHOD#include#include#includefloat valcal(float x){return (x*x*x);}int main(){float a,b,h,c,I;int n,i;printf("THE TRAPEZOIDAL RULE:\n");printf("---------------------");printf("\n\n\nEnter the two limits and the no. of divisions:\n");scanf("%f %f %d",&a, &b, &n);h=(b-a)/n;//printf("\nVALUE of h: %f\n", h);c=a;I=valcal(a)+valcal(b);//printf("\nVALUE FOR a: %f\n", valcal(a));//printf("\nVALUE FOR b: %f\n", valcal(b));for(i=1;i=b){printf("\n\nc>b\n\n");break;}//printf("\nVALUE FOR %f: is %f\n",c, valcal(c));I=I+(2*valcal(c));//printf("\nI right now is %f", I);}printf("\n\n\nThe integration of x*x*x is: %f",(h*I)/2);printf("\n\n\n");system("pause");}SIMPSON'S 1/3RD METHOD#include#include#includefloat valcal(float x){return (1/(1+x*x));}int main(){float a,b,h,c,I;int n,i;printf("THE SIMPSON'S ONE-THIRD RULE:\n");printf("------------------------------");printf("\n\n\nEnter the two limits and the no. of divisions:\n");scanf("%f %f %d",&a, &b, &n);h=(b-a)/n;//printf("\nVALUE of h: %f\n", h);c=a;I=valcal(a)+valcal(b);//printf("\nVALUE FOR a: %f\n", valcal(a));//printf("\nVALUE FOR b: %f\n", valcal(b));for(i=1;ib){printf("\n\nc>b\n\n");break;}//printf("\nVALUE FOR %f: is %f\n",c, valcal(c));if(i%2==0)I=I+(2*valcal(c));elseI=I+4*valcal(c);//printf("\nI right now is %f", I);}printf("\n\n\nThe integration of x*x*x is: %f",(h*I)/3);printf("\n\n\n");system("pause");}NEED MORE HELP...MAIL ME YOUR PROB... SEE YA
#include#includeint a,f,n,sum=0; printf("Enter any number"); scanf("%d",&n); f=1; for(a=1;a<=n;a ); { f=f*a; } for(f=1;f<=n;f ); { sum=sum f; } printf("sumation of factorial numbers :",sum); getch(); }
∫ f'(x)(af(x) + b)n dx = (af(x) + b)n + 1/[a(n + 1)] + C C is the constant of integration.
∫ f(x)nf'(x) dx = f(x)n + 1/(n + 1) + C n ≠-1 C is the constant of integration.
double n; for (n=1; n>0.00001; n/=2) printf("%f\n", n);
If we count 10 as 1 & 0, 11 as 1 & 1 and 12 as 1 & 2, then there are fifteen individual 'numbers' on the face of a standard clock. So, 15 N on a C F = 15 Numbers on a Clock Face
Well, NFFBC ("N double F B C!") stands for "No Friends For Butt Crack!" its just a chant.
#include<stdio.h> #include<conio.h> #include<math.h> float f(float x) { float y; if(x!=0) //y=sin(x)-log(x)+exp(x); y=1/(1+x); else printf("answer can not be derived"); return(y); } float g(float x) { float k; k=(-2)/(pow((1+x),3)); return(k); } void main() { float i,n,k,z,s=0,err=0; float h,x,a[100],b,c; clrscr(); printf("\n enter the range of the integration"); scanf("%f%f",&b,&c); printf("\n enter n so to divide the range into n parts"); scanf("%f",&n); h=(c-b)/n; printf("\n\n%f",h); k=(f(b)+f(c)); printf("\nk=%f\n\n",k); for(i=b+h;i<c;i+=h) { z+=f(i); printf("\n%f",z); } s=(h*(k+2*z))/2; printf("\n\n the value of the integration=%f\n\n",s); for(i=b;i<=c;i+=h) err+=g(i); err=(err*(pow(h,3)))/12; printf("\n\n approximate error= %f\n\n",err); getch(); }here...
Suppose N is a perfect number. Then N cannot be a square number and so N has an even number of factors.Suppose the factors are f(1) =1, f(2), f(3), ... , f(k-1), f(k)=N.Furthermore f(r) * f(k+1-r) = N for r = 1, 2, ... k so that f(r) = N/f(k+1-r)which implies that 1/f(r) = f(k+1-r)/NThen 1/f(1) + 1/(f(2) + ... + 1/f(k)= f(k)/N + f(k-1)/N + ... + f(1)/N= [f(k) + f(k-1) + ... + f(1)] / N= 2N/N since, by definition, [f(k) + f(k-1) + ... + f(1)] = 2N
Given an integer n, an integer f is a fraction of n if f goes into n evenly. That is, n/f is an integer or n = f*x for some integer x.m is a multiple of n if m = n*c for some integer c.
write a program in Java to find krishnamurti numbers( generally the logic of such questions is given in the question paper...i don't remember the logic , but i had written a program on this ) class krishnomurti { public static void main(int n) { int d,c,f=1,i,s=0; c=n; while(n>0) { d=n%10; n=n/10; for(i=1;i<=d;i++) { f=f*i; } s=s+f; f=f/f; d=d*0; } if(c==s) { System.out.println("yes"); } else { System.out.println("no"); } } }