C program : How to find FIBONACCI series #include int main(){ int k,r; longint i=0l,j=1,f; //Taking maximum numbers form user printf("Enter the number range:"); scanf("%d",&r); …
C program to find Factorial of a number
C program : How to find factorial of a number #include int main(){ int i=1,f=1,num; printf("Enter a number: "); scanf("%d",&num); while(i f=f*i; i++; } printf("Factorial of %…
C program which print its own source code as its output
C program : How to print own source code as output using c #include int main(){ FILE *fp; char c; fp = fopen(__FILE__,"r"); do{ c= getc(fp); putchar(c); } w…
C program to print hello world without using semicolon
C program : How to print hello world without using semicolon #include void main(){ if(printf("Hello world")){ } } Solution: 2 #include void main(){ while(!printf("Hello world")){ } } …
Find out LCM of two numbers
C program to find out LCM of two numbers: #include int main(){ int n1,n2,x,y; printf("\nEnter two numbers:"); scanf("%d %d",&n1,&n2); x=n1,y=n2; while(n1!=n2){ if(n1>n2) n1…
C program for solving quadratic equation
C program : How to solve quadratic equation using C #include #include int main(){ float a,b,c; float d,root1,root2; printf("Enter a, b and c of quadratic equation: "); scanf("%f%f%f"…
c program to find Variance, Mean, Standard Deviation
C program - How to Find Variance, Mean and Standard Deviation using C #include #include #include #define MAXSIZE 10 void main() { float x[MAXSIZE]; int i, n; float avrg, var, SD, sum=0, sum1=…
C program to convert days into years,weeks and days
C program : How to convert days into years,weeks and days #include #define DAYSINWEEK 7 void main() { int ndays, year, week, days; printf("Enter the number of days\n"); scanf("%d",&ndays); year …
c program to find out perfect number
C program - How to find out the perfect number #include int main(){ int n,i=1,sum=0; printf("Enter a number: "); scanf("%d",&n); while(i if(n%i==0) sum=sum+i; i…
c program to check given number is palindrome number or not
C program : How to check given number is palindrome number or not #include int main(){ int num,r,sum=0,temp; printf("Enter a number: "); scanf("%d",&num); temp=num; while(num…
Check given number is armstrong number or not
C program to check the given number is armstrong number or not #include int main(){ int num,r,sum=0,temp; printf("Enter a number: "); scanf("%d",&num); temp=num; while(num!=0)…
check given number is strong number or not
C program - How to check given number is strong number or not #include int main(){ int num,i,f,r,sum=0,temp; printf("Enter a number: "); scanf("%d",&num); temp=num; while(num){ i…