Posts

Showing posts from July, 2020

C program to find Factorial of any number

#include<stdio.h> int main() { int num, fact=1, i=1; printf("enter any number to find factorial \t"); scanf("%d",&num); while(i<=num) { fact=fact*i; i++; } printf("factorial = %d",fact); return 0; }

Psuedo math trick......

Do you know the value of  - 1-2+3-4+5-6+.........=1/4 Let  S=1-2+3-4+.......           _(1) Now adding s in equation (1) like binomial S=1-2+3-4+....... S=   1-2+3-4+....... 2S=-1+1-1+1-....... Now multiply by minus sign -2S=1-1+1-1+1-.......... We know that  1-1+1-1+1-........=1/2 //See my previous blog. Now -2S=1/2 S = -1/4

DO YOU KNOW SUM OF 1-1+1-1+1-...........=1/2

psuedo math..... DO YOU KNOW SUM OF 1-1+1-1+1-...........=1/2 》  s=1-1+1-1+1-........ now multiply by minus sign -s=-1+1-1+1-1+........ now add 1on both side 1-s=1-1+1-1+1-....... rhs value is equal to s then 1-s=s 2s=1 s=1/2