USING FOR LOOP THE CODE TO DISPLAY THE PATTERN OF FORWARD ARROW

September 22, 2018




                  Hello, In this blog we learn how to print the forward pattern using for loop. In C language the for loop is very useful, for loop include initialization, condition and incrementation. So by using this loop we print the pattern.

USING FOR LOOP THE CODE TO DISPLAY THE PATTERN:

#include<stdio.h>
#include<conio.h>
int main()
{int i, j, n;
printf ("ENTER THE NUMBER TO DISPLAY PATTERN ");
scanf ("%d",&n);
for(i=1; i<=n; i++)
{for(j=1; j<=i; j++)
{printf("♥ ");
}
printf("\n");
}
{ for(i=1; i<=n; i++)
{for(j=i; j<n; j++)
{printf("♥ ");
}
printf("\n");
}}
getch();
}

EXPLANATION:
             By using the concept of for loop we print the pattern. First we set the initial value of  'i'  i.e. i=1. then it checks the condition i.e. i<=n, n is the value given by the user. then control goes to next statement i.e. in next for loop and we set the initial value of j=1 and check the condition and print .
The execution goes out of the loop when the condition returns false. \n is use to print the statement at next line. So below we see the output of the given code.
             Also, we create other pattern using for loop, while loop or using if statement.

OUTPUT:
When inputted is 5

♥ ♥
♥ ♥ ♥
♥ ♥ ♥ ♥
♥ ♥ ♥ ♥ ♥
♥ ♥ ♥ ♥
♥ ♥ ♥
♥ ♥

                   In this code I'm using the ♥ sign you will use any sign. If you have any problem or question about this blog then write your doubt in the comment box.
                   Friends in next blog I will teach you another patterns.




USING FOR LOOP THE CODE TO DISPLAY THE PATTERN OF FORWARD ARROW USING FOR LOOP THE CODE TO DISPLAY THE PATTERN OF FORWARD ARROW Reviewed by Amit Waghmare on September 22, 2018 Rating: 5

USING FOR LOOP THE CODE TO DISPLAY THE PATTERN OF DOWNWARD HALF PYRAMID

September 22, 2018


USING FOR LOOP THE CODE TO DISPLAY THE PATTERN:

#include<stdio.h>
#include<conio.h>
int main()
{int i, j, n;
printf ("ENTER THE NUMBER TO DISPLAY PATTERN ");
scanf ("%d",&n);
for(i=1; i<=n; i++)
{for(j=i; j<=n; j++)
{printf("♥ ");
}
printf("\n");
}
getch();
}

OUTPUT:
When inputted is 5
♥ ♥ ♥ ♥ ♥
♥ ♥ ♥ ♥
♥ ♥ ♥
♥ ♥

In this code I'm using the ♥ sign you will use any sign. If you have any difficulty the write in the comment box. Friends in the next blog I will teach different patterns.




USING FOR LOOP THE CODE TO DISPLAY THE PATTERN OF DOWNWARD HALF PYRAMID USING FOR LOOP THE CODE TO DISPLAY THE PATTERN OF DOWNWARD HALF PYRAMID Reviewed by Amit Waghmare on September 22, 2018 Rating: 5

USING FOR LOOP THE CODE TO DISPLAY THE PATTERN OF HALF PYRAMID

September 22, 2018


USING FOR LOOP THE CODE TO DISPLAY THE PATTERN:

#include<stdio.h>
#include<conio.h>
int main()
{int i, j, n;
printf ("ENTER THE NUMBER TO DISPLAY PATTERN ");
scanf ("%d",&n);
for(i=1; i<=n; i++)
{for(j=1; j<=i; j++)
{printf("♥ ");
}
printf("\n");
}
getch();
}

OUTPUT:
When inputted is 5

♥ ♥
♥ ♥ ♥
♥ ♥ ♥ ♥
♥ ♥ ♥ ♥ ♥

In this code I'm using the ♥ sign you will use any sign. If you have any difficulty the write in the comment box. If you want all explanation of this code then type your comment, I will give you.




USING FOR LOOP THE CODE TO DISPLAY THE PATTERN OF HALF PYRAMID USING FOR LOOP THE CODE TO DISPLAY THE PATTERN OF HALF PYRAMID Reviewed by Amit Waghmare on September 22, 2018 Rating: 5

Introduction of loops in c language

September 22, 2018

                          Friends in c there are different types of loop statements like for loop, while loop, do-while loop, etc. and in this blog, I will explain the for loop, while loop and do-while loop.
●for loop:
                          for loop is entry controlled loop. When loop value returns true then the body of the loop executed till the value returns true, if loop value returns false controlled transfer to end of the program and the body will not be executed.

Syntax.
for(initialization; condition; incrementation)
{ body of the loop
}

●while loop:
                      This is the entry control loop or talk tested looping statement. This loop test the condition first if the condition returns true then the body of the loop is executed till the loop value returns true if the condition value returns false then the control is transfer to the out of the loop and body of the loop does not execute.

Syntax.
while (test the condition)
{
Body of the loop;
}

●do-while loop:
                     This is called as exit control or button tested looping statement. In this loop, the body of the loop executed first the condition will be check. If the condition returns true then the body of the loop executed continuously till the condition value returns true if condition value returns false then also the body of the loop is executed ones.

Syntax.
do
{
Body of the loop;
}
while (test the condition)

FRIENDS OUR LIFE IS LIKE A LOOP BECAUSE IN OUR LIFE MANY TURNS come AND ACCORDING TO THAT TURNS WE ARE MAKE A DECISIONS





Introduction of loops in c language Introduction of loops in c language Reviewed by Amit Waghmare on September 22, 2018 Rating: 5

code to find +,-,×,/ of two numbers

September 18, 2018


COMBINE CODE TO FIND THE
          ADDITION, SUBTRACTION, DIVISION, MULTIPLICATION, AND REMAINDER OF TWO NUMBERS

C language code for addition,subtraction,multiplication,division and modulo:

#include<studio.h>
#include<condo.h>
float main ()
{
float a, b,add, sub, mul, div, rem;
closcr();
printf ("ENTER THE TWO NUMBERS TO FIND THE ADDITION ,SUBTRACTION, MULTIPLICATION, DIVISION, REMAINDER\n");
scanf ("%f%f",&a&b);
add=a+b;
sub=a-b;
mul=a×b;
div=a/b;
rem=a%b;
printf ("ADDITION=%f\n", add);
printf ("SUBTRACTION=%f\n", sub);
printf ("MULTIPLICATION=%f\n", mul);
printf ("DIVISION=%f\n", div);
printf ("REMAINDER=%f\n", rem);
getch();
return();
}
                Friends in this code we perform all operations. If we use floating points then it accepts the integers also, so better way use float points.
                In this code clrscr() is new concept.It means that the previous output is clear. Try it automatically you learn.
The following images show the actual code and output screen.

                This is the input screen I.e.coding screen.




              This Window shows that there is no error in the code.

              This is the final output screen with example.

              Friends such information I was typing on mobile so remainder operations are not possible but on the latest version it did or on the computer it did easily.
              If any query is there then write in the comment box.Thank you...
     



code to find +,-,×,/ of two numbers code to find +,-,×,/ of two numbers Reviewed by Amit Waghmare on September 18, 2018 Rating: 5

C language code for division of two numbers

September 16, 2018



DIVISION OF TWO NUMBERS

SIMPLE C LANGUAGE CODE FOR DIVISION OF TWO NUMBERS:

#include<stdio.h>
#include<conio.h>
int main()
{int a, b, c;//we take two integer value
printf("Enter the number :");//use to print the letter, character
scanf("%d%d",&a,&b);//use to scan the accept number and scan it
c=a/b;//arithmetic logical operation, formula
printf("Ans=%d\n", c)/*use to perform operation and display answer*/
getch();
}

And save with extension .c
for eg.
div.c//div is the name of the file and .c is extension of file.
           In the above example, we can divide integer numbers not fractional numbers. for example when output screen comes type two numbers like 2 and press enter then type next numbers like 6 then press enter the answer print on the output screen.
            This code is for integer numbers, if we want to divide fractional numbers then in above code small changes is there i.e.in the place of int type float and at the place of % d type % f.For division of fractional numbers the code is as follow:

DIVISION OF TWO FRACTIONAL NUMBERS:
#include<stdio.h>
#include<conio.h>
float main()
{flaot a, b, c;//we take two fractional value
printf("Enter the number :");//use to print the letter, character
scanf("%f%f",&a,&b);//use to scan the accept number and scan it
c=a/b;//arithmetic logical operation, formula
printf("Ans=%f\n", c)/*use to perform operation and display answer*/
getch ();
}
Friends I hope you are learning for my blog , if you have any query then write in comment i will solve it.
In my next blog, I will teach you how to add all operations in one code.


C language code for division of two numbers C language code for division of two numbers Reviewed by Amit Waghmare on September 16, 2018 Rating: 5

C language code for multiplication of two numbers

September 16, 2018


MULTIPLICATION OF TWO NUMBERS

SIMPLE C LANGUAGE CODE FOR MULTIPLICATION OF TWO NUMBERS:

#include<stdio.h>
#include<conio.h>
int main()
{int a, b, c;//we take two integer value
printf("Enter the number :");//use to print the letter, character
scanf("%d%d",&a,&b);//use to scan the accept number and scan it
c=a×b;//arithmetic logical operation, formula
printf("Ans=%d\n", c)/*use to perform operation and display answer*/
getch();
}

And save with extension .c
for eg.
mul.c//mul is the name of the file and .c is an extension of the file.
           In the above example, we can multiply integer numbers, not fractional numbers. for example when output screen comes type two numbers like 2 and press enter then type next numbers like 6 then press enter the answer print on the output screen.
            This code is for integer numbers, if we want to multiply fractional numbers then in above code small changes is there i.e.in the place of int type float and at the place of % d type % f.For multiplication of fractional numbers the code is as follow:

MULTIPLICATION OF TWO FRACTIONAL NUMBERS:
#include<stdio.h>
#include<conio.h>
float main()
{flaot a, b, c;//we take two fractional value
printf("Enter the number :");//use to print the letter, character
scanf("%f%f",&a,&b);//use to scan the accept number and scan it
c=a×b;//arithmetic logical operation, formula
printf("Ans=%f\n", c)/*use to perform operation and display answer*/
getch ();
}


        Friends not only education but also experience is the key to success because we know that practice makes a man perfect.
 
Friends you like maths subject if yes then don't matter but most of my friends don't like maths then love on maths automatically maths love on you. This is simple trick try it and tell me in the comment box you like maths or not.



C language code for multiplication of two numbers C language code for multiplication of two numbers Reviewed by Amit Waghmare on September 16, 2018 Rating: 5

C language code for subtraction of two numbers

September 15, 2018



SUBTRACTION OF TWO NUMBERS

SIMPLE C LANGUAGE CODE FOR SUBTRACTION OF TWO NUMBERS:

#include<stdio.h>
#include<conio.h>
int main()
{int a, b, c;//we take two integer value
printf("Enter the number :");//use to print the letter, character
scanf("%d%d",&a,&b);//use to scan the accept number and scan it
c=a-b;//arithmetic logical operation, formula
printf("Ans=%d\n", c)/*use to perform operation and display answer*/
getch();
}

And save with extension .c
for eg.
SUB.c//SUB is the name of the file and .c is an extension of the file.
           In the above example, we can subtract integer numbers not fractional numbers. for example when output screen comes type two numbers like 2 and press enter then type next numbers like 6 then press enter the answer print on the output screen.
            This code is for integer numbers, if we want to subtract fractional numbers then in above code small changes is there i.e.in the place of int type float and at the place of % d type % f.For subtraction of fractional numbers the code is as follow:

SUBTRACTION OF TWO FRACTIONAL NUMBERS:
#include<stdio.h>
#include<conio.h>
float main()
{flaot a, b, c;//we take two fractional value
printf("Enter the number :");//use to print the letter, character
scanf("%f%f",&a,&b);//use to scan the accept number and scan it
c=a-b;//arithmetic logical operation, formula
printf("Ans=%f\n", c)/*use to perform operation and display answer*/
getch ();
}

Friends in most trades maths are the most important factor escape some courses.MATHEMATICS is one type of magic so we must make a maths magician then automatically we made our life magician.
         Friends if you like my blogs then please write a comment in the comment box.



C language code for subtraction of two numbers C language code for subtraction of two numbers Reviewed by Amit Waghmare on September 15, 2018 Rating: 5

C language code for addition of two numbers

September 14, 2018


 ADDITION OF TWO NUMBERS

SIMPLE C LANGUAGE CODE FOR ADDITION OF TWO NUMBERS:

#include<stdio.h>
#include<conio.h>
int main()
{int a, b, c;//we take two integer value
printf("Enter the number :");//use to print the letter, character
scanf("%d%d",&a,&b);//use to scan the accept number and scan it
c=a+b;//arithmetic logical operation, formula
printf("Ans=%d\n", c)/*use to perform operation and display answer*/
getch();
}

And save with extension .c
for eg.
add.c//add is the name of the file and .c is an extension of the file.
           In the above example, we can add integer numbers not fractional numbers. for example when output screen comes type two numbers like 2 and press enter then type next numbers like 6 then press enter the answer print on the output screen.
            This code is for integer numbers, if we want to add fractional numbers then in above code small changes is there i.e.in the place of int type float and at the place of % d type % f.For addition of fractional numbers the code is as follow:

ADDITION OF TWO FRACTIONAL NUMBERS:
#include<stdio.h>
#include<conio.h>
float main()
{flaot a, b, c;//we take two fractional value
printf("Enter the number :");//use to print the letter, character
scanf("%f%f",&a,&b);//use to scan the accept number and scan it
c=a+b;//arithmetic logical operation, formula
printf("Ans=%f\n", c)/*use to perform operation and display answer*/
getch ();
}

     In a previous blog I said that many types of comment is there in that other type is/*   */. This is used to give the multiline comments for example.
printf("Ans=%f\n", c)/*use to perform operation and display answer*/

I hope you like my blog so if any queries is there then write in comment box.I will solve it.Friends in next blog I will teach you the another program.
   

YOU MUST LEARN C FOR EFFECTIVE FUTURE

C language code for addition of two numbers C language code for addition of two numbers Reviewed by Amit Waghmare on September 14, 2018 Rating: 5

Simple C program

September 13, 2018

      Programming Tutorials


Hello Friends. I think you are read my first blog and I hope you learned from my previous blog. In this blog, I will teach you the actual code of C language.








SIMPLE C LANGUAGE CODE:

#include<stdio.h>    //standard I/O function

#include<conio.h>  //MSN-DOS compiler

void main()             //execution is started from this line

{                             //starting of program body

printf("HELLO WORLD",\ n);//to print the text on O/P screen

getch();                   //it holds the O/P screen

}                             //ending of program body

------------------------------------------------------------------------------------------

And save with extension .c

for eg.

simple.c//simple is the name of the file and .c is an extension of the file.

// Is one type of comment e.g.

void main();//Execution is started from this line.There are other functions available in c but, I will teach you in the next blog.......


Simple C program Simple C program Reviewed by Amit Waghmare on September 13, 2018 Rating: 5

History of C language

September 09, 2018

                     

             

                                   LEARN C LANGUAGE

      

                                                  In the world, there are many programming languages like HTML, java, c, c++, c#, Python, Arduino, riberry pi, etc. And in this blog, I will teach you the C language.

INTRODUCTION:

 ●History of C:


                       1) C is the general purpose programming language.

                       2) This language is developed by Dennis Ritchie in 1974 at AT and T bell labs.

                       3) C has become a widely used professional language for various reasons.

                            Because the C language is easy to learn, it is a structured language, it produces efficient programs and it can be compiled on a variety of computers.

 ○The following chart shows the history of C:


International group                 -   ALGOL               -       1960

Martin Richards                     -   BCPL                   -        1967

Ken Thompson                       -   C                          -        1970

Dennis Ritchie                        -   Traditional C       -        1972

Kernighan and Ritchie           -   K & Rc                 -        1978

ANSI Committee                    -   ANSIC                 -        1989

ISO Committee                       -   ANSI/ISO            -        1990

Standardization committee     -   C 99                      -        1999

                                              C language was invented to write OS called Unix.C is the successor of B language which was introduced around 1970. This language was formalized in 1988 by ANSI. (American National Standard Institute).In 1972 Unix OS almost totally written in C.Today C is the most widely used system programming language. Most of the state of art software has been implemented using C.

                                             C is widely used for system development work. C was adopted as a system development language because it produces code that runs nearly as code written in assembly language.

●Features of C:

                       1) Flexibility:C is the general purpose programming language and it is used for various applications.

                    2)Powerful: Provides a variety of data types, control flow instruction, structured program, and other built-in functions.

           3) Small in size: Provide I/O facility. Help to keep the language small.

           4)Modular design:C wrote its function. It also allows the user to define/design own function.

           5) Portability: If we run code on one computer then we will also copy it and as it is run on another computer with small modifications or without modifications.

           6) Low-level features C closely related to ALGOL, making the language easier to understand.

           7) Efficiency: Development efficiency and machine efficiency is good to mean faster to execute.

            This is the basic information of the C language. In the next blog, I will teach you the actual coding, programs...





History of C language History of C language Reviewed by Amit Waghmare on September 09, 2018 Rating: 5