C and c++ series program part-1

C is a general-purpose language which has been closely associated with the  Unix operating system for which it was developed.In 1972, Dennis Ritchie at Bell Labs writes C and in 1978, the publication of The C Programming Language by Kernighan & Ritchie caused a revolution in the computing world.

Bjarne Stroustrup, a Danish computer scientist, began his work on C++’s predecessor “C with Classes” in 1979. The motivation for creating a new language originated from Stroustrup’s experience in programming for his Ph.D. thesis.

Here are some solved C and c++ series program part-1

C and c++ series program part-1

C and c++ series program part-1

1

12

123

1234

12345

 

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

Void main()

{

Int I,j;

For(i=1;i<=5;i++)
{
  For(j=1;j<=I;j++)
  {
   Printf(“%d”,j);
  }
 Printf(“\n”);
}

getch();

}

2)

54321
5432
543
54
5

 

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

Void main()
{
  Int I,j;
  For(i=1;i<=5;i++)
   {
     For(j=5;j>=I;j--)
      {
          Printf(“%d”,j);
       }
     Printf(“\n”);
     }
  getch();
}

3)

*

***

*****

*******

*********

***********

 

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

Void main()
{
   Int I,j;
  For (i=1;i<=11;i=1+2)
   {
      For(j=1;j<=I;j++)
       {
         Printf(“ * “);
         }
     Printf(“\n”);
    }
Getch();
}

4)

10101

1010

101

10

1

 

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

Void main()
{
  Int I,j;
  For(i=5;i>=1;i--)
   {
     For(j=1;j<=I;j++)
      {
             If(j%2==0)
                  Printf(“ 0 “);
             Else
                  Printf(“  1 ”);
        }
      Printf(“\n”);
       }
     Getch();
     }

5)

*********

    *******

     *****

        ***

           *

 

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

Void main()
{
Int I,j,sp=1;
For(i=9;i>=1;i=i-2)
{
   For(j=1;j<=sp;j++)
         Printf(“ “);
   For(j=1;j<=I;j++)
     {
        Printf(“ * “);
       }
Pritnf(“\n”);
Sp++;
}Getch();
}


To get your series solutions ,post your series in comment box below just enter your name and email address and post your series to get answer

To get more series or you want to get any series solution just post your series in our comment box. Also, you can mail us at [email protected] or you can also contact us through our facebook page www.facebook.com/soluversity.

click here for more quiz on programming language “C”:https://www.soluversity.in/quiz-4-c-programming-language

Give us to your feedback to make our page contents and designing better.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *