Search Blog

Saturday, April 16, 2022

How to Add Two Array(or Matrix) ?

  Here We Will Learn To Program C. I'll try To give my Best To Make you understand.


                                                                         "Let's Begin"


A Programme To Add Two Matrix or Array.

We Have Determined The Maximum Length Of Array to Be  5 x 5(a[5][5]).
a[5][5]= Matrix A. b[5][5]=  Matrix B. sum[5][5]= Output Or Sum Matrix.
i and are Taken As Loop Elements.(To Run The Loop)
 as Numbers Of Rows & as Numbers Of Column which Are taken From User(Max length 5)
In Total 6 Loop Are Used Two For "A Matrix" , Two For "B Matrix" and Two For Sum And Printing of the Sum Matrix. 

OUTPUT

 Download Link Of Above Programme:-

How to Use it.
Download File >Go To Turboc3(or turboc folder)>bin>Paste File>
open Turbo c Application>File>open(or F3)>Select File
 
NOTE:- Above File Can Be Opened With Other Compilers(Like code blocks, visual studio, etc.), Some Changes Might Require.

 THANKS

Friday, April 15, 2022

How to Built and Print(or Display) an Array(or Matrix) User Friendly?

              Here We Will Learn To Program C. I'll try To give my Best To Make you understand.


                                                                         "Let's Begin"


A Programme To Built an Array.(Max length 5 x 5)
USER FRIENDLY

Here We Are Making Two By Two Array.
We Have Determined The Maximum Length Of Array to Be  5 x 5(a[5][5]).
i and j are Taken As Loop Elements.(To Run The Loop)
 as Numbers Of Rows & c as Numbers Of Column which Are taken From User(Max length 5).
In Total 4 Loops are used 2 for Taking Inputs And 2 For giving Outputs. 

Understand From Outputs


OUTPUTS

 Download Link Of Above Programme:-

How to Use it.
Download File >Go To Turboc3(or turboc folder)>bin>Paste File>
open Turbo c Application>File>open(or F3)>Select File
 
NOTE:- Above File Can Be Opened With Other Compilers(Like code blocks, visual studio, etc.), Some Changes Might Require.

 THANKS

Tuesday, April 12, 2022

How to Built and Print(or Display) an Array(or Matrix)?

              Here We Will Learn To Program C. I'll try To give my Best To Make you understand.


                                                                         "Let's Begin"
            
Lets Learn To Create an Array. In Next Blog We Will Create a User Friendly Array Programme.
A Programme To Built an 2 by 2 Array(2-D Array).

An Array is Used To Store Multiple Values In A Single Variable. 
Array Is Mainly Of 3 Types =>
* 1D Array => Data_Type Variable_Name[No Of Rows];
* 2D Array => Data_Type Variable_Name [No Of  Rows][No. Of Column];
* Multi D Array => Data_Type Variable_Name[Size1][Size2][Size3]...[Size n];
Before Using any Variable In Programming You Need To Determine Its Data Type. 
Here We Are Making 2D Array.
Initialization Of An 2D Array int a[2][2];
In The Next Four Line The Value is Given to the Array.

To Print Array Looping Is An Important Part. 
i,j Is Used to Determine Rows And Column To Print an Array.
For Multi D Array The Number of Loop will Increase.

OUTPUT

Download Link Of Above Programme:-

How to Use it.
Download File >Go To Turboc3(or turboc folder)>bin>Paste File>
open Turbo c Application>File>open(or F3)>Select File
 
NOTE:- Above File Can Be Opened With Other Compilers(Like code blocks, visual studio, etc.), Some Changes Might Require.

 THANKS

Saturday, April 9, 2022

How To Use Switch Case ?

             Here We Will Learn To Program C. I'll try To give my Best To Make you understand.


                                                                         "Let's Begin"

A Programme to Get Grade Brief 
Using Switch Case

Syntax:-switch(Variable or Name)
{
                           case '1st Value': 
                            work to done
                  break;
                          case '1st Value':
                           work to done
                  break;
                         case '1st Value':
                            work to done
                   break; 
           default:
                            work to done
}
SWITCH CASE is A Beautiful Thing in c.It is Very Useful.In This The Varible Is Taken And Value of  it Checked By Different case.We Can add Infinite Cases.And A Default is Taken if the value isn't matches for Any Cases The Default work Is done

In this Programme "a" is Taken From user.Here "a" is Grade of The user(Recommended from A-F).
Their Are 6 Cases(A-F) With Different work. For Ex:- If User Entered A Then Case 1 i.e. Case 'A':
 Will run And EXCELENT Will Be printed. This Thing Will Happen for all The Cases.
Default :  If The Value Doesn't Matches For All The Cases Then Default will Run.
break; is Used to Stop The Running programme Hence it says "Switch Your Work Is Done HAha".

OUTPUTS 




Download Link Of Above Programme:-

How to Use it.
Download File >Go To Turboc3(or turboc folder)>bin>Paste File>
open Turbo c Application>File>open(or F3)>Select File
 
NOTE:- Above File Can Be Opened With Other Compilers(Like code blocks, visual studio, etc.), Some Changes Might Require.

 THANKS

Wednesday, March 30, 2022

How To Swap Values of Two Numbers?

            Here We Will Learn To Program C. I'll try To give my Best To Make you understand.

                                                               "Let's Begin"

A Program To Swap Value Of Two Numbers.

In Swapping Of Two Numbers the main Work is of Just 3 Lines.
c=a;
a=b;
b=c;
If you are A Mathematics Student Its easy to Understand.
If NOT then I'll Make U Understand. 2 Value is taken from User a&b.We Need To Swap Their Value.1st c=a; value of Given to c. Then Value of b Given to a. Then Value Of c Given To b.
Here How The Value is Swapped .


OUTPUT

Download Link Of Above Programme:-

How to Use it.
Download File >Go To Turboc3(or turboc folder)>bin>Paste File>
open Turbo c Application>File>open(or F3)>Select File
 
NOTE:- Above File Can Be Opened With Other Compilers(Like code blocks, visual studio, etc.), Some Changes Might Require.

 THANKS

Thursday, March 10, 2022

How to use and What is The use of Continue in Loop Statements(for,while,do while)?

            Here We Will Learn To Program C. I'll try To give my Best To Make you understand.

                                                               "Let's Begin"

A Programme To Use Continue in Loops. 

Now I Will only Make to guys understand only the New Function. To Understand other thing 
Please Check My other BLOGS.

What Continue do in a Loop? What is The work of Continue?
Continue can Be used in Any Loop(for,while,do while).It is Used To Stop The Loop for That particular Value and Run it for Next Value.
Here, j is taken From User. In if i==j(i is said to be equal to j) means at i==j the if goes true and continue  will work.

Lets Understand With Output.

 Here, j=5 At i=5 continue will not let the loop run forward but ask him to go to starting
Means at j=5=i printf("%d\n",i); will not run due to continue.We cant se 5 in output.

Similarly at j=2

At j=10

 Download Link Of Above Programme:-

How to Use it.
Download File >Go To Turboc3(or turboc folder)>bin>Paste File>
open Turbo c Application>File>open(or F3)>Select File
 
NOTE:- Above File Can Be Opened With Other Compilers(Like code blocks, visual studio, etc.), Some Changes Might Require.

THANKS

Wednesday, March 9, 2022

How To Get Multiplication Table of Any Number?

            Here We Will Learn To Program C. I'll try To give my Best To Make you understand.

                                                               "Let's Begin"

A Programme to Get Multiplication Table of 
Any Numbers.

Now I Will only Make to guys understand only the New Function. To Understand other thing 
Please Check My other BLOGS.

Here we have taken Input 'a'using 'scanf("%d",&a);'.
Now loop is run 10 Times from i=1 to i<=10(10 is included).
Inside Then loop print Function and An Operation is used'printf("%dx%d=%d",a,b,a*b);'.
!st %d will print a,2nd %d willl print b and 3rd %d will print a*b.

                                                                                     
                                     

OUTPUTS
   
Download Link Of Above Programme:-

How to Use it.
Download File >Go To Turboc3(or turboc folder)>bin>Paste File>
open Turbo c Application>File>open(or F3)>Select File
 
NOTE:- Above File Can Be Opened With Other Compilers(Like code blocks, visual studio, etc.), Some Changes Might Require.

THANKS


   

Sunday, February 20, 2022

How to Print any Statement More than 1 time using DO WHILE Loop?

            Here We Will Learn To Program C. I'll try To give my Best To Make you understand.

                                                               "Let's Begin"

A Programme to Print "Myself Sahil Saini" 10 time
                using DO WHILE Loop
 
Now I Will only Make to guys understand only the New Function. To Understand other thing 
Please Check My other BLOGS.

  • int i=1;
    do
    {
         printf("Myself Sahil Saini");
         i++;
    }
    while(i<11);
                       Here int i=1; int stand for Integer . Value of i is initialized here.                    SYNTAX:-[do{}while(text expression);].i++ stats that Value of i will increase by 1.

OUTPUT

Download Link Of Above Programme:-

How to Use it.
Download File >Go To Turboc3(or turboc folder)>bin>Paste File>
open Turbo c Application>File>open(or F3)>Select File
 
NOTE:- Above File Can Be Opened With Other Compilers(Like code blocks, visual studio, etc.), Some Changes Might Require.

THANKS

Wednesday, February 16, 2022

How to Print any Statement More than 1 time using WHILE Loop?

            Here We Will Learn To Program C. I'll try To give my Best To Make you understand.

                                                               "Let's Begin"

A Programme To Print "MySelf Sahil Saini " 10 Times using 
WHILE Loop

 Now I Will only Make to guys understand only the New Function. To Understand other thing Check My other BLOGS

  • int i=1;
    while(i<11)
    {
           printf("Myself Sahil Saini");
           i++;
    }

    Here int i=1; int stand for Integer . Value of i is initialized .  while(i<11){} [syntax :- while(Test expression){}]. The Loop will run till 10 it will stop at 11 or greater value. Hence It will run 10 times. You Can run it more by Changing Test Expression. Value is exceeded by 1 Using i++. We can do increment by 2 or Greater Value by writing i=i+2(for 2 Increment) or i=i+n(for Increment of n Natural Number).

OUTPUT

Download Link Of Above Programme:-

How to Use it.
Download File >Go To Turboc3(or turboc folder)>bin>Paste File>
open Turbo c Application>File>open(or F3)>Select File
 
NOTE:- Above File Can Be Opened With Other Compilers(Like code blocks, visual studio, etc.), Some Changes Might Require.

THANKS

Saturday, February 5, 2022

How to Print any Statement More than 1 time using FOR Loop?

            Here We Will Learn To Program C. I'll try To give my Best To Make you understand.

                                                               "Let's Begin"

A Programm to Print "Myself Sahil Saini" 10 times.

From Now I Will only Make to guys understand only the New Function. To Understand other thing Check My other BLOGS

  • for(i=1;i<11,i++)
    {
             printf("Myself Sahil Saini")
    }   
     Here FOR loop is used. SYNTAX-for(Initialization Statement; Test Expression; Increment) {}. In Initialization Statement we will Initialize or give the value of the variable(i=1). In Test Expression is the condition of the loop and will only run If the condition is True(i<11) Here the loop will close at i =11 or Greater Value. In Increment we increase the value of the Variable(i++) menas increament by 1.                        

Output

Download Link Of Above Programme:-

How to Use it.
Download File >Go To Turboc3(or turboc folder)>bin>Paste File>
open Turbo c Application>File>open(or F3)>Select File
 
NOTE:- Above File Can Be Opened With Other Compilers(Like code blocks, visual studio, etc.), Some Changes Might Require.
THANKS

Tuesday, February 1, 2022

How to do Comparison Of ANY Two Numbers?

            Here We Will Learn To Program C. I'll try To give my Best To Make you understand.

                                                               "Let's Begin"

A Program To Do Comparision Of Two Numbers

Lets Understand It.

  • #include<stdio.h>
    #include<conio.h>

    void main()

    {}
    This is the Starting of Nearly Every Programme.
    In this # is Preprocessor Directives used to Include a header File.
    stdio.h stands for Standard Input Output Header File and conio.h  stands for Console Input Output Header File. 
    stdio.h includes function like printf(),scanf(),etc.
    conio.h
    includes function like clrscr(),getch(),etc.
    void main()
    means starting pf main programme.
    "{}" program must be written in Between of curly brackets. 
  • clrscr() stands for Clear screen,used to clear screen.If we don't write it then we can see the old Output.
  • int a,b; here int stant for Integer And Allow only Numerical data to be Entered in a b and c.
    a and c represent  Variables.Variable  is a address or storage where the Data is Stored.
  • if(a>b)
    {
           printf("%d is Greater Number",a);
    }
    IF
    is conditional Statement means used to give condition. A conditional statement has only Two answer TRUE  and  FALSE. If is a TRUE conditional statement.
    Curly Brackets '{}' works like a Gate .If the condition(a>b) is true then the Data will Print or run inside the Bracket.If the Condition is FALSE then the next condition will be checked.  
  • else if(b>a)
    {
           print("%d is Greater Number",b);

    ELSE IF 
     is also a TRUE Conditional Statement.WE Can ADD as my condition We Have using else if().
  • else
    {
            printf("BOTH are Equal")
    }
    ELSE
    is a FALSE Conditional Statement.It prints or run False Data .
  • getch() stands for get character. It is important to see output or it is used to stop screen on output screen
OUTPUTS
a=23   &    b=12


a=12    &    b=23
                        
     
a=23    &   b=23


Download Link Of Above Programme:-

How to Use it.
Download File >Go To Turboc3(or turboc folder)>bin>Paste File>
open Turbo c Application>File>open(or F3)>Select File
 
NOTE:- Above File Can Be Opened With Other Compilers(Like code blocks, visual studio, etc.), Some Changes Might Require.

THANKS

Sunday, January 30, 2022

How to do Addition, Subtraction, Multiplication, Division and Modulus of ANY Two Numbers?

            Here We Will Learn To Program C. I'll try To give my Best To Make you understand.

                                                               "Let's Begin"

A program to do Addition, Subtraction, Multiplication,
Division and Modulus of ANY Two Numbers



Lets Understand It.

  • #include<stdio.h>
    #include<conio.h>

    void main()

    {}
    This is the Starting of Nearly Every Programme.
    In this # is Preprocessor Directives used to Include a header File.
    stdio.h stands for Standard Input Output Header File and conio.h  stands for Console Input Output Header File. 
    stdio.h includes function like printf(),scanf(),etc.
    conio.h
    includes function like clrscr(),getch(),etc.
    void main()
    means starting pf main programme.
    "{}" program must be written in Between of curly brackets. 
  • clrscr() stands for Clear screen,used to clear screen.If we don't write it then we can see the old Output.
  • int a,b,c; here int stant for Integer And Allow only Numerical data to be Entered in a b and c.
    a,b and c represent  Variables.Variable  is a address or storage where the Data is Stored.
  • printf("Enter Two Numbers:- "); .printf stands for print file.
  • scanf("%d%d",&a,&b); .scanf is used to take Input From User. It is Very Important to Make Your Data User Friendly.
    %d specifies type of Data Ex 12,234,etc. %d for Whole Number Data(-infinity to +infinity),%f for Float Data(Decimal Data),%c is for Character Data(a to z ,A to Z) And Many More.  is used as address of a and b.
  • c is used to perform every Operation(+ Addition,- Subtraction, * Multiplication, / Division,% Modulus(Remainder)) on Two variables.Value of c is changed every time.
  • printf("Add or Sub or Div or Mul or Mod of Numbers:-%d \n",c); . %d specifies type of Data and Telss that c will print HERE.\n is used to print the data in next line. 
  • getch() stands for get character. It is important to see output or it is used to stop screen on output screen.
                            

OUTPUT



Download Link Of Above Programme:-

How to Use it.
Download File >Go To Turboc3(or turboc folder)>bin>Paste File>
open Turbo c Application>File>open(or F3)>Select File
 
NOTE:- Above File Can Be Opened With Other Compilers(Like code blocks, visual studio, etc.), Some Changes Might Require.

THANKS

Saturday, January 29, 2022

How to print your Name or Anything in C?

 Hi, Lets Begin from Starting.

            Here We Will Learn To Program C. I'll try To give my Best To Make you understand.

                                                               "Let's Begin"

A Program to Print Your Name OR Anything
Lets Understand It.

  • #include<stdio.h>
    #include<conio.h>

    void main()

    {}
    This is the Starting of Nearly Every Programme.
    In this # is Preprocessor Directives used to Include a header File.
    stdio.h stands for Standard Input Output Header File and conio.h  stands for Console Input Output Header File. 
    stdio.h includes function like printf(),scanf(),etc.
    conio.h
    includes function like clrscr(),getch(),etc.
    void main()
    means starting pf main programme.
    "{}" program must be written in Between of curly brackets. 
  • clrscr() stands for Clear screen,used to clear screen.If we don't write it then we can see the old Output.
  • printf("My self Sahil Saini "); .printf stands for print file. you can write anything instead of My self Sahil Saini (Your name,number,etc) but bracket, semicolan and quation mark will remain same.
getch() stands for get character. It is important to see output or it is used to stop screen on output screen.
Output 

Download Link Of Above Programme:-
How to Use it
Download File >Go To Turboc3(or turboc folder)>bin>Paste File>
open Turbo c Application>File>open(or F3)>Select File
 
NOTE:- Above File Can Be Opened With Other Compilers(Like code blocks, visual studio, etc.), Some Changes Might Require.

   Thanks

How to Add Two Array(or Matrix) ?

    Here We Will Learn To Program C. I'll try To give my Best To Make you understand.                                                   ...