Posts

Exploring Pascal's Triangle in C: A Code Breakdown

Introduction: Pascal's Triangle, a beautiful mathematical construct, has fascinated mathematicians and computer scientists alike for centuries. Named after the French mathematician Blaise Pascal, this triangular array of numbers holds the key to a multitude of mathematical and combinatorial mysteries. In this blog post, we'll delve into a C program that calculates and prints rows of Pascal's Triangle based on user input. We'll break down the code, step by step, to understand how it works. #include <stdio.h> int fact(int n) {          int factorial = 1;          for (int i = 2; i <= n; i++) {         factorial *= i;     }     return factorial; } int main() {     printf("How many rows do you want to be printed?\n");     int k;     scanf("%d", &k);     for (int i = 0; i < k; i++) {         for (int j = 0; j <= i; j++) { ...

Finding Area of a Square using C language

 #include<stdio.h> int main() {     float side;     printf("Please Enter the side square : ");     scanf("%f", &side);     printf("Area of the square is : %f", side*side);     return 0; }     My YouTube Channel :: Viral Bhoi - YouTube Thanks for visiting my Blog. Hopefully it helped you. Please check out more blogs for practice. We will meet soon. bye. Jay Hind...

Doing divide Using C language.

 #include<stdio.h> int main() {     int x ,y ;     printf("Enetr x: ");     scanf("%d", &x);     printf("Enetr y: ");     scanf("%d", &y);     printf("div. of x and y is :  %d",x/y);     return 0; }     My YouTube Channel :: Viral Bhoi - YouTube Thanks for visiting my Blog. Hopefully it helped you. Please check out more blogs for practice. We will meet soon. bye. Jay Hind...

Doing subtraction using C language.

 #include<stdio.h> int main() {     int x ,y ;     printf("Enetr x: ");     scanf("%d", &x);     printf("Enetr y: ");     scanf("%d", &y);     printf("diff. of x and y is :  %d",x-y);     return 0; }     My YouTube Channel :: Viral Bhoi - YouTube Thanks for visiting my Blog. Hopefully it helped you. Please check out more blogs for practice. We will meet soon. bye. Jay Hind...

Doing product using C language.

 #include<stdio.h> int main() {     int x ,y ;     printf("Enetr x: ");     scanf("%d", &x);     printf("Enetr y: ");     scanf("%d", &y);     printf("product of x and y is :  %d",x*y);     return 0; }     My YouTube Channel :: Viral Bhoi - YouTube Thanks for visiting my Blog. Hopefully it helped you. Please check out more blogs for practice. We will meet soon. bye. Jay Hind...