Powered By Blogger

Thursday 26 March 2020

How to print a word or sentence inside double quotation(i.e " ") in 'C' programming

Welcome viewers to this new blog............

Today,we will print any word or sentence inside double quote using 'printf' function in 'c' programming.


Printing sentence within double quotes


As we all already know, how to print any word or sentence or value using "printf" function in 'c' programming.

for example, if we want to print a sentence: To Infinity & Beyond
then, we write: 
                          printf("To Infinity & Beyond");

Output:  To Infinity & Beyond


But have we ever tried to print it inside double quotation(" ") to make them look better.

If you simply want to write it in the 'printf' function, then it will show you an error.

for example:
                     printf(""To Infinity & Beyond"");

Output: (no output)
You should get an error.

Error Message


So, to print any word or sentence inside the double quotation, we need to write the program in the following way:

                                   printf("\"To Infinity & Beyond\"");

Writing the printf function to print double quote


Output:     "To Infinity & Beyond"

Output Window


So, we need to use (\") before the starting of the word or sentence and again one more(\") after the completion of the sentence.

So, that is the simple method by which you can print any word or sentence inside double quotation using 'printf' function in 'c' programming.

Hope, this helps you. Thank you very much for reading my blog. Do comment and share if this helps you. Thank you.

PRINT HOLLOW DIAMOND OF NUMBERS IN 'C' PROGRAMMING (PRINTING PATTERN IN 'C')

PRINT HOLLOW DIAMOND OF NUMBERS IN 'C' PROGRAMMING (BY ANY NUMBER THAT CAN BE DIVIDED BY 4 IN 'C' PROGRAMMING)


WELCOME VIEWERS TO MY NEW BLOG. LET'S SEE WHAT IS TODAY'S PATTERN

HOLLOW DIAMOND PATTERN IN 'C'


Today, we will print this quite diamond-like pattern in 'c' with numbers distributed as in the above picture.

First, let's see the programming code for this hollow diamond printing..........

PROGRAMMING CODE TO PRINT UPPER HALF OF THE DIAMOND

PROGRAMMING CODE TO PRINT LOWER HALF OF THE DIAMOND



FULL PROGRAMMING CODE TO PRINT THR DIAMOND



Here is the PDF file link to download the programming code......

CLICK ON DOWNLOAD BUTTON


Wednesday 25 March 2020

Difference between Left justified and right justified format in 'c' that is "%nd" and "%-nd" in the format specifier of 'C' programming (n denotes any numerical value)

First, we need to know, what is format specifier in 'c programming?




The format specifier specifies the format of the printable or scannable variable whether it is an integer(%d), floating point (%f), character(%c), string(%s) etc. which we want to print or scan from the user.

That means it tells the compiler about the format of the taken variable which we want to print or scan.

For example: 
                     printf("%c",a);
Compiler understands that the format to print the value of the variable 'a' is a character type.
                      scanf("%f",&x);
This time compiler understands that the format to read the variable 'x' is a floating-point type.

This is simple to understand.
Now, when we add any value before any format specifier, let's see what happens.
For example:. printf("%3d",a);
Let, a=12345
Naturally ,itwill print the value of 'a' i.e 12345 though we have specified the integer limit i.e 3.
But if a=12
Then, it will print:.  (space)12
That is when the no. of number of 'a' exceeds the integer limit(%3d), then it prints the whole value of the corresponding variable i.e. 12345(n=total numbers=5).
But for the second case, as the total numbers in 'a' are less than the integer limit, then it prints the required space before the numbers to adjust the limit. For this, it prints only one space as there is total of two numbers in 'a'.

If a=356
printf("%5d",a);

Then the output will be:

(space) (space) 356

Now, coming to our main part.
At most, we have seen the use of only positive integer limits, but if we take negative, then what will happen?

Let's see, if we take the negative integer limit, then the variable value will be printed in "Left justified" way.

For example: 
x=1356
printf("%-5d",x);

The output will be:
1356(space)
That means this time, the value of the variable is printed first and thereafter the required number of spaces printed, this type of form is called "Left justified" form

So, we conclude that, if the total numbers in a variable are less than the given integer limit then, for positive limit the value will be printed in "Right justified form" and for negative limit, it will be printed in "Left justified form".

This feature is very useful to print spaces before or after any value for good visualization of output frame in 'C' programming.

Hope, this helps you. Thank you very much for reading.

Sunday 22 March 2020

EVALUATION OF AN EQUATION AND SUM USING ‘GOTO’ AND ‘POW’ FUNCTION IN ‘C’ PROGRAMMING...


EVALUATION OF THE FOLLOWING EQUATION AND SUM USING ‘GOTO’ AND ‘POW’ FUNCTION IN ‘C’ PROGRAMMING...

EQUATION FOR EVALUATION OF SUM IN 'C'
EQUATION FOR EVALUATION OF SUM IN 'C'





SUM= (1+X+X2+X3+X4+..........+Xn)

Today in this we are going to discuss the above equation and to evaluate the Sum by using ‘goto’ function and ‘pow’ function in ‘C’ programming.
So, let's start...............
Before starting let's see the programming code used here.......

PROGRAMMING CODE IN 'C' PROGRAMMING
PROGRAMMING CODE IN 'C' PROGRAMMING





INITIALIZATION PART: here, we have taken ‘sum’ and ‘x’ as float value.
Then we have taken two variables ‘n’ and ‘i’ as an integer value. Lastly, a character variable has been taken as ‘choice’.
This is the initialization part, we will see the use of the above variables in the following parts.


float sum,x;

int n,i;
char choice;

Let's move to the argument making part.

ARGUMENT MAKING  AND MAIN CODING PART:  In this part, we will see the use of ‘goto’ and ‘pow’ function. Lets what is this thing and how they work?

“GOTO” FUNCTION:  The function is already included in stdio.h header file. This function mainly works to move to the control to a position of the programme where it is set to move. That means it can move the control of the execution in any part of the program code.

For example: if we write a program
                      int n,x;
                     input: printf(“Enter the value of ‘n’”);
                     scanf(“%d”,&n);
                     if(n%2==0)
                         {           
                                printf( “The number can be divided by 2”);
                          }
                      else
                         {
                               printf(“The number can’t be divided by 2”);
                          }
                      printf(“Do you want to continue? press 0 or 1”);
                     if(x==1)
                      {
                           goto input;
                       }
                       else

                       printf(“Thank you........”);



By the above program, we can decide that the number given by the user can be divided by 2 or not.  Then we are taking a decision from the user whether he wants to continue or repeat the program again or not. So, we need here the ‘GOTO’ function. For this, we need to specify a location in the program which tells the compiler to repeat the execution of the program once more or again and again according to the input from the user. So, we have marked the location as “input”. Remember after specifying the location and taking the variable, there should be a colon after the declaration of the location i.e (input:) and the code format will be “goto(space) (name as given in the location)”.

In the given example if the user gives input ‘1’ then the control goes to the “input” named location.
Thus, repeating the execution once more.

Now, What is “pow”?
‘POW’ denotes power. It is a math function included in “math.h” header file. So, before using ‘pow’ function we must include the ‘math.h’ header file in the header section. The function mainly helps to make the power of a number.
It is as the following format:



                                                          pow((number),(power))



for example:  pow(2,4)==24==16   or  pow(3.5,2)==3.52==12.25
That how the ‘POW” function works.


let's move to our coding section.
we have used here a ‘for loop’ to evaluate the value of the sum.

        sum=1;

for(i=1;i<=n;i++)
{
sum=sum+pow(x,i);
}


As seen, inside ‘for loop’ the argument  is  “sum=sum+pow(x, i)”
taken sum=1  and ‘for loop’ starts with i=1 up to i<=n.

If user gives the input x=4 and n=3 then,
So, when i=1
sum=1+pow(4,1)==5

Now, the present value of ‘sum’=65
when i=2
sum=5+pow(4,2)==21

Now,the present value of ‘sum’=21
when i=3
sum=21+pow(4,3)=85

So, the evaluated ‘sum’ is equal to 85.

This way the argument works with ‘pow’ function by the argument  “sum=sum+pow(x,i)”

Now, the ‘for loop’ ends.

Next, we are moving towards the user’s decision making section where he/she chooses whether he wants to repeat the program once more or not.


printf("\n\nDo you want to continue ?\nPress y or n.....\n");
fflush(stdin);                  /*it is used to make the scanf function to get input from user without skipping*/
scanf("%c",&choice);            /* or a space before %c can also do the same*/
if(choice=='y'||choice=='Y')
{
    printf("\n\n");
goto input;
}
else
    printf("\n\nThank You......");



Here, we are taking input from the user in the form of “Y/y or N/n”.
NOTE: We have used a function “fflush(stdin)” to stay the input from the user at the time of asking from the user. It can also be achieved by giving a (space) before the formatting string “%c” i.e. “(space)%c”. Without it, the input from the user can’t be taken, it will skip the respective ‘scanf’ part, thus not getting any input from the user. You can try it and see what is happening without it.
Then, we have taken an ‘if’ function with the condition      
                 if(choice==’Y’||choice==’y’)
As the input from the user is saved in the variable ‘choice’ , so we have given this condition. Here the sign ‘||’ stands for “OR” meaning and remember the sign ‘&&’ stands for “AND” meaning. If the user enters capital ‘Y’ or(||)  small ‘y’ then, as per ‘GOTO’ function control moves to ‘input’ location in the program. Otherwise, the program ends with printing “Thank you......”


Hope, the given example is understandable to you. If any doubt persists please comment below and if this helps you please share the blog. Thank you so much............. 

Thursday 19 March 2020

List of ASCII values in 'C' Programming with Pdf

For your comfortability I am giving here the List of important ASCII values and also pdf is given below.

For better understanding, please go through the given example in the following link:  Click Here



ASCII  VALUE  OF  CHARACTERS

THE ASCII VALUES ARE VERY IMPORTANT FOR PROGRAMMING. BY THIS VALUES COMPILER UNDERSTANDS ANY CHARACTER. ASCII VALUES ARE INTEGER VALUES OF THE CORRESPONDING CHARACTER.
THE CONCEPT WILL BE MORE CLEAR TO YOU BY SOME EXAMPLES GIVEN ON MY BLOG:
2nfinityandbyond.blogspot.com
for example : 
CLICK HERE


ASCII VALUES
ASCII VALUES

ASCII VALUES
ASCII VALUES




Click ON download

Tuesday 17 March 2020

C Programme to Reverse a Number using While Loop And Arrray functions


Print numbers in Reverse Order In ‘C’ programming using While Loop & Array functions.............


Programming Code for printing Reverse Number in 'C
Reverse number printing in 'C'



Welcome viewers to my new blog on how to print numbers in reverse order in ‘C’ programme. Today we will deal with this interesting programme and coding with ‘C’. This is also a simple programme in ‘C’ but it needs some understanding in the compilation of the programme. So, without wasting time lets start the programme.

In this programme, we will use the “Modulus(%)” function to some extent. The property of the function will be described in its respective position.

  • First, we are coming to the variable part :
We have taken three variable for this programme i.e num,num1 and rev.
‘num’ denotes ‘number’ which we will take the input from the user.
‘num1’ is another variable to apply a modulus function,. We will see its use in the programming part.
‘rev’ denotes ‘reverse’ which saves the Reverse Value of the given number.

  • Second, The programming part :

Before starting let's talk about the ‘Modulus’ function in ‘C’ briefly.
‘Modulus’ function is nothing but the remainder of a division process.
Let's take an example:
If we take a number – 1234 and divide it with 10.
Then, 1234%10==4 that is the remainder of the division.
If we divide 542 with 5, then 542%5==2.
i.e. in programming  int x;
                                     x=542%5;
                                     printf(“%d”,x);
              Output:   2

Here, we have used a ‘while loop’ to perform this programme. It is given with a condition “num!=0”.
It means until the value of ‘num’ become equals to zero, the loop iterates.

Inside the loop, we have given an argument  “num1=num%10”  It means after the calculation of num%10, the value will be stored as num1 and each time the while loop iterates the value of the variable ‘num’ changes according to the argument given inside the loop.  This argument is given because we are trying to print the given number into reverse order, so we use modulus function it gives us the remainder of the division and thus giving us the last most digit of the number as we are the dividing the number with 10. It is discussed clearly in the next argument section.

Next, argument is “num=num/10”. It should be noted that the variable ‘num’ is taken as an integer value. So, after diving a number with 10 it will save only the integer value, not floating-point value.
If we take a number – 5421
Then 5421/10==542(integer value) not 542.1(floating point value).
This condition plays a vital role in the ‘while loop’ iteration and also in performing the previous argument.
Before going to the third argument part, we will take some examples of how the above mentioned two arguments are working in this programme.
If we take a number- 1347. So, num=1347
Then,
1st argument: “num1=num%10”
So, num1=1347%10==7. That means we are getting the last most digit of the given number by the ‘Modulus function’.
Moving to the next argument
2nd argument: “num=num/10”
So, num=1347/10==134 (the only integer value is stored as num)
After completing of the first loop iteration, the while condition is checked i.e ‘num!=0’  (‘!’- not equal to), if the condition is true the loop iterates otherwise it gets out of the loop.
For the taken example loop will iterate a total of 4 times.
For 2nd iteration: The present value of ‘num’=134
1st argument: num1=134%10==4. That means we are getting the second digit from the backside of the number.
2nd argument: num=134/10==13 (not 13.4)
For 3rd iteration: The present value of ‘num’=13
1st argument: num1=13%10==3. That means we are getting the third digit from the backside of the number.
2nd argument: num=13/10==1
For 4th and the last iteration: The present value of ‘num’=1
1st argument: num1=1%10==1. That means we are getting the fourth digit from the backside of the number or the first digit of the number.
2nd argument: num=1/10==0

And after the completion of 4th iteration the value of ‘num’==0, so ‘while loop’ condition is violated and thus the iteration of loop stops.
Now, coming to the most important the 3rd argument. It is basically doing the job making the number in reverse order. Let's see the argument

rev=num1+(rev*10)
For 1st  iteration of ‘while loop’ :  num=1347 , num1=7
So, rev=7+(0*10) . In the variable declaration section we have taken the initial value of ‘rev’=0.
rev==7
For 2nd  iteration of ‘while loop’ :  num=134 , num1=4 ,rev=7
rev=4+(7*10)==74
For 3rd  iteration of ‘while loop’ :  num=13 , num1=3 ,rev=74
rev=3+(74*10)==743
For 4th and the last iteration of ‘while loop’ :  num=1 , num1=1 ,rev=743
rev=1+(743*10)==7431
Then the value of num becomes zero as 1/10==0( again remember num is taken as an integer value)
‘while loop’ condition now becomes false and it stops to iterate.

Thus, the final value of ‘rev’ becomes 7431 i.e the reverse order of the given number 1347.
This is how the whole process proceeds. The entire programming code is given below:

C programme to reverse a number using while loop
Programming Code for printing Reverse Number in 'C'




This programme can be done with the use of ‘ARRAY’. Stay tuned for it. Hope, you understand the explanation and the programme. Please, share and comment if this helps you. If any question, please comment below. Thank you for reading.......

Sunday 15 March 2020

Pyramid printing pattern in 'C' programming with ALPHABETS


Hello, viewers welcome to my new blog on pattern printing in ‘C’ language with alphabets. So, let's start.........

Before going into the coding part let us have a look at the pattern that we want to print in ‘C’.


printing pattern in 'C' programming
Printing Pattern of Pyramid with Alphabets

So, today we will print the above pattern in ‘C’ and as we can see that the printing pattern is based on alphabetical order, so we need some knowledge about ASCII values. We will discuss it meanwhile.

We can see the printing pattern is formed of alphabets but there’s an interesting thing happens that in every line or rows the alphabets become printed in their sequential order but after the printing of alphabet in the middle part of a line, the alphabets then started to print in opposite order i.e. back counting order. For example, if we take the line or row no:3, then we can see that up to the middle of the line, alphabets are printed in their sequential order i.e ABC. But when we proceed further, it is seen that alphabets have become started to print in opposite sequence i.e. previous-ABC + now- BA (ABCBA). So, this is an important part of this printing pattern. 

Now, let's see what is ASCII values?

In simple words, it is nothing but the converted integer values of character, strings or some special character by which compiler understands the respective character or string etc.
For upper case letters , ASCII value starts from 65 to 90 (A==65 ,B==66,C==67 to Z==90) and for lower case letters, ASCII values starts from 97 to 122 (a==97,b==98,c==99 to z==122).
It will be more clear if we take the following example.....
if we write a print function: int x=65;
                                                    printf(“%d”,x);
then the output will be: 65
but if we change the format specifier from %d to %c, it will print its corresponding ASCII character.
i.e.         printf(“%c”,x);
output: A                          
Hope you understand. Now, lets take a look at our programming part.

  1. Outer "For Loop":-We have used here a total of 4 ‘for loops’ (1 outer and 3 inner ‘for loops’). For first ‘for loop’ we have made a condition that will make the loop iterate for ‘n’ times which means it will print ‘n’ number of lines or rows according to the input of the user.            int i,j,k,n;
    printf("enter the value of n: ");
    scanf("%d",&n);
    for(i=1;i<=n;i++)
    {
  2. Nested "For Loop":-
  • First 'Inner Loop':   
           Then, the first inner’ for loop’ begins with a condition of printing spaces up to (n-i) times for each iteration of the outer loop. So, when the value of i=1,n=4 the loop will print (n-i)=(4-1)=3 spaces for first row or line,when i=2,n=4 the loop will print 4-2=2 spaces for second-row or line and so on.

for(j=1;j<=n-i;j++)

{
printf(" ");
}
  • Second 'Inner Loop':  
         For the second inner ‘for loop’, there’s the condition for alphabet printing in sequential order up to ‘i’ times for each time the outer loop iterates. When the value of i=1, it prints only one alphabet(A), when i=2, it prints two alphabets(AB), when i=3 it prints three alphabets (ABC) in sequential order and so on. Thus, the second inner ‘for loop’ completes its iteration.


for(k=1;k<=i;k++)
{
    printf("%c",k+64);
}
  • Third 'Inner Loop':
          For the third inner ‘for loop’, we need to remember after the iteration of 2nd inner for loop, the 3rd inner loop immediately starts to print alphabet in opposite order i.e.(if the 2nd loop prints “ABCD” then the 3rd loop will print “CBA”). So, the condition is given when k=i-1 and k>0. We can see, when i=1,k becomes k=(i-1)=1-1=0, so it will not print any alphabet, when i=2, k=2-1=1, so it will print one alphabet(i.e. A), when i=3, k=3-1=2, so it will print two alphabets(i.e. BA) but in the opposite order, as 'k' is given as a decrement operator(k--) and check the condition until K>0. 


for(k=i-1;k>0;k--)
{
printf("%c",k+64);
}

Thus, the entire “Nested For Loop” goes on.

NOTE: In the print section, we have added 64 with the value of ‘k’ to get the ASCII values of upper case alphabet(when k=1,k+64=65==A; when k=2,k+64=66==B). If we want to get lower case alphabet then, we need to 96 with ‘k’ as lower case letters start from ASCII values of 97.

Thus, the entire Programming Code is as follows:



Hope you understand the printing pattern and programming code. Please share and comment if this helps you. Thank you very much.

Thursday 12 March 2020

Different types of Pattern and Tree structure in 'C' programming (Making A "Pine Tree")


Welcome viewers  to another new ‘C’ structure or pattern ........
In this blog, we will print a "
Pine tree" with the help of ‘for loop’,’ while loop and some ‘if-else’ function. So, let's start...
First, let's look at the pattern of the tree.
TREE STRUCTURE IN 'C' PROGRAMMING
TREE STRUCTURE IN 'C' PROGRAMMING

We can see the tree has three same types of ‘Head part’ i.e upper part. And then followed by the five stared ‘Stock part’ and at the base of it, there is also five “=” character.
So, we need to first with the ‘head part’. As this part continues for three times, so we can make a ‘while loop’ with a condition of looping three times and printing the same pattern.
For ‘Stock part’ we need to use a simple  ‘for  loop’ that will print a ‘*’ with newline character at the time of each star printing.
For ‘Base’ there is also a simple ‘for loop’ that will iterate 5 times to print the “=” characters.
Now, let's see how the program is going on :
PROGRAMMING CODE IN 'C' TO PRINT A TREE PATTERN
PROGRAMMING CODE IN 'C'

(i)”HEAD PART” or “UPPER PART”:- 

                                                                Here, we have first set a while loop that will iterate 3 times as stated earlier. Then we have made a for loop whose value will start from 1 and it will check the condition i<=n(here,n=3) which means the loop will iterate until the loop is executed 3 times. Then an inner is set with a condition j<=n-i(for first iteration n=3 and i=1, for second i=2, third i=3 and so on) for printing the spaces before printing the stars to give the proper shape of a tree. Here, the loop will print spaces until j<=n-i (for the first case it prints 2 spaces as j=3-1=2; for the second case it prints 1 space as j=3-2=1; for third, it will print any space as j=3-3=0).

Then the next ‘for loop’ comes for the printing of stars according to the pattern. Here the condition will be different i.e. k<=(2*i-1) as we need to print stars in ‘odd order’. For first case i=1;k=1; it prints only one star (it should be noted, the spaces are printing at their respective positions before printing stars as per previous ‘for loop’), for second case i=2;k=3, prints 3 stars and for third case i=3;k=5 prints 5 stars.
Now, as the while loop is given so the same will iterate or execute 3 times and thus printing the “head part” of the ‘TREE’.

while(x<=3)
{
    for(i=1;i<=n;i++)
    {
    for(j=1;j<=n-i;j++)
    {
    printf(" ");
    }
    for(k=1;k<=2*i-1;k++)
    {
        printf("*");
    }
  printf("\n");
    }
  x++;
    }

(ii)”STOCK PART”:-
                                  It is a simple part. Here we have for loop with a ‘if-else’ function. The loop is executed a total of 10 times(5 times for the stock part and the rest for the base part).
"If statement" is given to check the condition that the loop is iterated less than 6 times for ‘stock printing’ and inside if statement there is another for loop that will print spaces and then stars with a new line the character at the time of each iteration.
Thus, the ‘stock part’ is printed.

for(i=1;i<=10;i++)
   {
  if(i<6)
  {
     for(j=1;j<=2;j++)
     {
     printf(" ");
     }
     printf("*\n");


(iii)”BASE PART”:-
                                In the previous ‘if statement’ we get the ‘else part’ also, so it is basically for base part printing(“=”). The for loop will execute another 5 times thus completing its total 10 iterations (5 in ‘if’+5 in ‘else’) and printing the’=’ characters . Thus printing the base part.

 for(i=1;i<=10;i++)
   {
  if(i<6)
  {
     for(j=1;j<=2;j++)
     {
     printf(" ");
     }
     printf("*\n");
      }
      else
        printf("=");
   }
}


This is all about printing a “TREE” using ‘C’ Programming. It can also be done in another way (stay tuned). Thank you..............


Wednesday 11 March 2020

Let's Learn some Pyramidal structures using 'C' programming (i.e. printing number pyramid with '*')

Hello viewers, your heartiest welcome to my blog.
Today in this blog I am going to discuss a number pyramid structure using 'c' language.
I think you all programmers or beginners have already known the simple '*' triangle printing, don't worry if it is not well understood by you. I will try my best to make you habituated with all these things.
So, let's start.
Before going into the complex structure, we first try to understand the simple triangle in short.
In these cases of star printing we need to use for loop or while loop etc. because we need to do the same work for many times (i.e. printing '*','**','****' etc), so it is better to use loop functions. One may think about printing stars in increasing or decreasing order as given in the question by using printf function with a new line character(\n) without any looping. But when you will face a situation of printing more than 10 or 20 or 30 or >30 lines pyramid, it will not be easy to print the pyramid with only 'printf ' function and moreover, it will be a time-consuming process also. So, while printing 'star(*)' pyramid we should use some loop functions, most of the cases it is "for loop". Hope you understand why we use loop function in various structure printing in 'C'.
Let's see in the following:
You are asked to print a star triangle with one star incrementing and having five lines in the pyramid.
You might have done it earlier, for this structure we first check how many lines (rows) are there in the pyramid. It has 5 lines so, we should set a loop that will iterate(execute) 5 times,so we set a loop which will start from 1 and execute total of 5 times. That's not all, we also need to print stars according to increasing order. So, we must think with the iteration of the for loop, there should be another loop that print stars, add a new line and increment stars at their respective positions.
We must be careful about that the second loop should be inside the first 'for loop' and this type of looping is known as "Nested For Loop". Otherwise, star printing will not be in correct order.
Let's see the programming:

We have taken first for loop that will iterate 5 times, but inside it there's another loop. let's look inside the second loop. Here in the condition checking j<=i that mean when the value of i=1,j<=1, so it will print only one '*', then it goes back to first loop again. At this time the value of i=2 and then it enters in the inner loop and it checks condition j<=2(as the present value of i=2), so the inner loop will iterate two times printing 2 stars('**'). Then control goes to first loop again and i becomes i=3,then inner loop j<=3(as present value of i=3),so loop iterate 3 times printing 3stars('***'). And this process goes on until i=5.
It should be noted that every time after printing stars control goes to the next statement that is "new line character"(\n) and prints a new line each time after the completion of the inner loop. This way the whole process goes on.
There's a short program summary


#include<stdio.h>
int main()
{
int i,j;
for(i=1;i<=5;i++)           /*Outer for loop iterate 5 times*/
{
for(j=1;j<=i;j++)  /*inner 'for loop' iterate 'i' times for every iteration of outer 'for loop'*/
{
printf("*");  /*printing '*' */
}                             /* end point of inner for loop'*/
printf("\n");        /*printing new line character*/
}                                    /*end point of outer for loop*/
}

Thank you.

Can we use pointers without specifying the data type of the pointer?

Void Pointer Yes, we can use pointers without specifying the data type of the pointers. But remember at the end of the programming, wh...