<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-3172594483165237090</id><updated>2024-12-18T19:26:12.326-08:00</updated><category term="Array"/><category term="Basic programs"/><category term="Advanced C"/><category term="Function"/><title type='text'>C LANGUAGE</title><subtitle type='html'>The site contents Educational regarding C language.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='https://ahvicoding.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/3172594483165237090/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='https://ahvicoding.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Ahvi</name><uri>http://www.blogger.com/profile/16050488529644377675</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>10</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3172594483165237090.post-7577235454040095810</id><published>2021-07-25T09:54:00.001-07:00</published><updated>2021-07-25T09:54:55.417-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Advanced C"/><title type='text'>(1+2+3.....n) Sum of n natural numbers, (1^2 + 2^2+3^2 ...... n^2)Sum square of n natural numbers, Sum cube of n natural numbers  program in C language .</title><content type='html'>&lt;p&gt;&amp;nbsp;&lt;span style=&quot;font-size: x-large;&quot;&gt;&amp;nbsp;Natural numbers program in c language&amp;nbsp;&lt;/span&gt; &amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&amp;nbsp;H&lt;span style=&quot;font-size: medium;&quot;&gt;ow to make&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;(1+2+3.....n) Sum of n natural numbers, (1^2 + 2^2+3^2 ...... n^2)Sum square of n natural numbers, Sum cube of n natural numbers program in C language. Then today we will know about it through this program ...&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: #2b00fe; font-size: large;&quot;&gt;&lt;b&gt;Sum of n natural numbers&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;The Sum of n natural number formula are 1+2+3+....n = n(n+1)/2=(n^2+n)/2. The math.h header file is used in this program because the pow() function is defined in this header file. The function pow() syntax is&lt;span style=&quot;color: #800180;&quot;&gt; &lt;/span&gt;&lt;i&gt;&lt;b&gt;&lt;span style=&quot;color: #800180;&quot;&gt;double pow(double a , double b).&lt;/span&gt;&amp;nbsp;&lt;/b&gt;&lt;/i&gt;The double is a data type in c language and it&#39;s also defined as %lf for input. In this program add= (k+x)/2 where are k=n^2 ,x=n.&lt;/span&gt;&lt;/p&gt;


&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;
&lt;textarea id=&quot;comments&quot; name=&quot;comments&quot; style=&quot;background-color: lightblue; border: none; color: black; font: 18px / 30px sans-serif; height: 383px; margin: 0px; padding: 2%; width: 557px;&quot;&gt;/*SUM OF N NATURAL NUMBERS*/
#include&quot;stdio.h&quot;
#include&quot;math.h&quot;
int main()
{
	double x,y=2;
	printf(&quot;ENTER THE NATURAL NUMBER:&quot;);
	scanf(&quot;%lf&quot;,&amp;x);
	double n=pow(x,y);
	int add=(n+x)/2;
	printf(&quot;SUM OF N NATURAL NUMBER:%d&quot;,add);	
}&lt;/textarea&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size: large;&quot;&gt;Output is :&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;background-color: #2b00fe;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;b&gt;&lt;i style=&quot;background-color: #ffd966;&quot;&gt;ENTER THE NATURAL NUMBER:6&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;b&gt;&lt;i style=&quot;background-color: #ffd966;&quot;&gt;SUM OF&amp;nbsp; N NATURAL NUMBER:21&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&amp;nbsp;&lt;span&gt;&lt;b style=&quot;color: #2b00fe; font-size: x-large;&quot;&gt;Sum square of n natural numbers :&lt;br /&gt;&lt;/b&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;The Sum square of n natural number formula is&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: black; font-size: large;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;span&gt;1&lt;sup&gt;2&lt;/sup&gt;+2&lt;sup&gt;2&lt;/sup&gt;+3&lt;sup&gt;2&lt;/sup&gt;…….n&lt;sup&gt;2&lt;/sup&gt;&amp;nbsp;= n(n+1)(2n+1)/6 =&amp;nbsp;&lt;/span&gt;(2n&lt;sup&gt;3&lt;/sup&gt;+3n&lt;sup&gt;2&lt;/sup&gt;+n)/6. In this program add=&amp;nbsp;(q+w+x)/6; where are&amp;nbsp;q=3n&lt;sup&gt;2&lt;/sup&gt;, w=2n&lt;sup&gt;3&lt;/sup&gt;&amp;nbsp;and&amp;nbsp; x=n.&lt;/span&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;b&gt;&lt;i style=&quot;background-color: #ffd966;&quot;&gt;&lt;br /&gt;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/form&gt;&lt;br /&gt;


&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;
&lt;textarea id=&quot;comments&quot; name=&quot;comments&quot; style=&quot;background-color: lightblue; border: none; color: black; font: 18px / 30px sans-serif; height: 446px; margin: 0px; padding: 2%; width: 591px;&quot;&gt;/*SUM SQUARE OF N NATURAL NUMBERS*/
#include&quot;stdio.h&quot;
#include&quot;math.h&quot;
int main()
{
	double x,y=2,l=3;
	printf(&quot;ENTER THE NATURAL NUMBER:&quot;);
	scanf(&quot;%lf&quot;,&amp;x);
	double q=3*pow(x,y);
	double w=2*pow(x,l);
	int add = (q+w+x)/6;
	printf(&quot;SUM SQUARE OF N NATURAL NUMBER:%d&quot;,add);	
}
&lt;/textarea&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size: x-large;&quot;&gt;Output is :&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;i style=&quot;background-color: #ffd966;&quot;&gt;ENTER THE NATURAL NUMBER:4&lt;/i&gt;&lt;/span&gt;&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;i style=&quot;background-color: #ffd966;&quot;&gt;SUM SQUARE OF&amp;nbsp; N NATURAL NUMBER:30&lt;/i&gt;&lt;/span&gt;&lt;/form&gt;&lt;br /&gt;&lt;span&gt;&lt;span style=&quot;color: #2b00fe; font-size: x-large; font-weight: bold;&quot;&gt;Sum cube of n natural numbers :&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;span style=&quot;color: black; font-weight: 400;&quot;&gt;The Sum cube of n natural number formula is&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: 400;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;&lt;span&gt;1&lt;sup&gt;3&lt;/sup&gt;+2&lt;sup&gt;3&lt;/sup&gt;+3&lt;sup&gt;3&lt;/sup&gt;
+…..n&lt;sup&gt;3&lt;/sup&gt;&amp;nbsp;=&lt;/span&gt;&lt;span style=&quot;line-height: 107%;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;span style=&quot;line-height: 107%;&quot;&gt;[n(n+1)/2]&lt;/span&gt;&lt;sup&gt;2 &lt;/sup&gt;or =[(n&lt;sup&gt;2&lt;/sup&gt;&amp;nbsp;+n)/2&lt;span style=&quot;line-height: 19.26px;&quot;&gt;]&lt;/span&gt;&lt;sup&gt;2&lt;/sup&gt;.In this program add= pow(q,y);&amp;nbsp; y=2, q = (k+x)/2,and[{ x=n,k=n&lt;sup&gt;2&lt;/sup&gt;&amp;nbsp;}].&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;


&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;
&lt;textarea id=&quot;comments&quot; name=&quot;comments&quot; style=&quot;background-color: lightblue; border: none; color: black; font: 18px / 30px sans-serif; height: 487px; margin: 0px; padding: 2%; width: 603px;&quot;&gt;/*SUM CUBE OF N NATURAL NUMBERS*/
#include&quot;stdio.h&quot;
#include&quot;math.h&quot;
int main()
{
	double x,y=2;
	printf(&quot;ENTER THE NATURAL NUMBER:&quot;);
	scanf(&quot;%lf&quot;,&amp;x);
	double k=pow(x,y);
	int q=(k+x)/2;
	int add=pow(q,y);
	printf(&quot;SUM CUBE OF N NATURAL NUMBER:%d&quot;,add);	
}
	
&lt;/textarea&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size: xx-large;&quot;&gt;Output is :&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;background-color: #ffd966;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;i&gt;ENTER THE NATURAL NUMBER:4&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;&lt;span style=&quot;background-color: #ffd966;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;i&gt;SUM CUBE OF NATURAL NUMBER:100&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/form&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='https://ahvicoding.blogspot.com/feeds/7577235454040095810/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://ahvicoding.blogspot.com/2021/07/123n-sum-of-n-natural-numbers-12-2232.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/3172594483165237090/posts/default/7577235454040095810'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/3172594483165237090/posts/default/7577235454040095810'/><link rel='alternate' type='text/html' href='https://ahvicoding.blogspot.com/2021/07/123n-sum-of-n-natural-numbers-12-2232.html' title='(1+2+3.....n) Sum of n natural numbers, (1^2 + 2^2+3^2 ...... n^2)Sum square of n natural numbers, Sum cube of n natural numbers  program in C language .'/><author><name>Ahvi</name><uri>http://www.blogger.com/profile/16050488529644377675</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3172594483165237090.post-3232552123754870604</id><published>2021-07-15T21:36:00.003-07:00</published><updated>2021-07-15T21:51:03.578-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Array"/><title type='text'>Matrix Addition and subtraction program in C language </title><content type='html'>&lt;p&gt;&amp;nbsp;&lt;span style=&quot;color: #351c75; font-size: x-large;&quot;&gt;&lt;b&gt;Matrix Addition and Subtraction program in C language&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Today here you will be able to learn about multiple tasks in Matrix-like addition, subtraction, and multiplication.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;@#1.Matrix Addition&amp;nbsp;&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Suppose that we have two matrices of 3X3 orders. This matrix A and B. In this program&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwc4ymRsI-TiORGpYIrr6-h-9bh98NeUT5w9Hfrli9Do40uwdQ16K8Bg3yGVScW2XYtYFtqhXqwWS-0NKcNAC5GasqES7T6eIz-SIL9bZnXAEfJKemXJLYYsuO0HjuvxR5nV0OZGWF0SU5/s973/NASUB.PNG&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;585&quot; data-original-width=&quot;973&quot; height=&quot;367&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwc4ymRsI-TiORGpYIrr6-h-9bh98NeUT5w9Hfrli9Do40uwdQ16K8Bg3yGVScW2XYtYFtqhXqwWS-0NKcNAC5GasqES7T6eIz-SIL9bZnXAEfJKemXJLYYsuO0HjuvxR5nV0OZGWF0SU5/w611-h367/NASUB.PNG&quot; width=&quot;611&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;C is the addition of A &amp;amp; B; i and k are used for initialization.&lt;/span&gt;&lt;div&gt;&lt;span style=&quot;color: #073763; font-size: xx-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #073763; font-size: xx-large;&quot;&gt;Matrix Addition Program&amp;nbsp;&lt;/span&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;

&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;
&lt;textarea id=&quot;comments&quot; name=&quot;comments&quot; style=&quot;background-color: lightblue; border: none; color: black; font: 17px / 30px sans-serif; height: 1595px; margin: 0px; padding: 2%; width: 613px;&quot;&gt;#include&quot;stdio.h&quot;
int main()
{
int A[10][10],B[10][10],C[10][10],i,k,row,col;
printf(&quot;Enter The Matrix row &amp; col = &quot;);
scanf(&quot;%d %d&quot;,&amp;row,&amp;col);
printf(&quot;Enter the First matrix :\n&quot;);
for(i=0;i&lt;row;i++)
{
 for (k=0;k&lt;col;k++)
{
printf(&quot;Enter matrix[%d][%d]=&quot;,i,k);
scanf(&quot;%d&quot;,&amp;A[i][k]);
}
}
printf(&quot;First matrix are:\n&quot;);
for(i=0;i&lt;row;i++)
{
 for (k=0;k&lt;col;k++)
{
printf(&quot;%d\t&quot;,A[i][k]);
}
printf(&quot;\n&quot;);
}
printf(&quot;Enter the Second matrix :\n&quot;);
for(i=0;i&lt;row;i++)
{
 for (k=0;k&lt;col;k++)
{
printf(&quot;Enter matrix[%d][%d]=&quot;,i,k);
scanf(&quot;%d&quot;,&amp;B[i][k]);
}
}
printf(&quot;Second matrix are:\n&quot;);
for(i=0;i&lt;row;i++)
{
 for (k=0;k&lt;col;k++)
{
printf(&quot;%d\t&quot;,B[i][k]);
}
printf(&quot;\n&quot;);
}
printf(&quot;Matrix sum are:\n&quot;);
for(i=0;i&lt;row;i++)
{
 for (k=0;k&lt;col;k++)
{
	C[i][k]=A[i][k]+B[i][k];
	printf(&quot;%d\t&quot;,C[i][k]);
}
printf(&quot;\n&quot;);
}
}&lt;/textarea&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #20124d; font-size: x-large;&quot;&gt;Output is:&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Enter The Matrix row &amp;amp; col = 2&lt;/span&gt;&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;3&lt;/span&gt;&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Enter the First matrix :&lt;/span&gt;&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Enter matrix[0][0]=2&lt;/span&gt;&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Enter matrix[0][1]=1&lt;/span&gt;&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Enter matrix[0][2]=3&lt;/span&gt;&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Enter matrix[1][0]=6&lt;/span&gt;&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Enter matrix[1][1]=54&lt;/span&gt;&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Enter matrix[1][2]=7&lt;/span&gt;&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;First matrix are:&lt;/span&gt;&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3&lt;/span&gt;&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;6&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;54&amp;nbsp; &amp;nbsp; &amp;nbsp; 7&lt;/span&gt;&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Enter the Second matrix :&lt;/span&gt;&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Enter matrix[0][0]=8&lt;/span&gt;&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Enter matrix[0][1]=9&lt;/span&gt;&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Enter matrix[0][2]=6&lt;/span&gt;&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Enter matrix[1][0]=4&lt;/span&gt;&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Enter matrix[1][1]=1&lt;/span&gt;&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Enter matrix[1][2]=3&lt;/span&gt;&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Second matrix are:&lt;/span&gt;&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;8&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;9&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;6&lt;/span&gt;&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3&lt;/span&gt;&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Matrix sum are:&lt;/span&gt;&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;10&amp;nbsp; &amp;nbsp; &amp;nbsp; 10&amp;nbsp; &amp;nbsp; &amp;nbsp; 9&lt;/span&gt;&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;10&amp;nbsp; &amp;nbsp; &amp;nbsp; 55&amp;nbsp; &amp;nbsp; &amp;nbsp; 10&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;@#2.Matrix Subtraction&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; Two matrices a &amp;amp; b.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgKrJDJ65nwNEg0bCAUkECBSFegnBNSpoL9c4t-7QouoYuxnW3y3maSwYYiox2SXWP5fRNB4B-bRvV1-jGe-RzXq7AdCCw1uwIEwO-dwlz13OEEgGEIqzcqFLv9wC9Xn_9UQQs68fZu5-K/s988/NADD.PNG&quot; style=&quot;margin-left: 1em; margin-right: 1em; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;590&quot; data-original-width=&quot;988&quot; height=&quot;387&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgKrJDJ65nwNEg0bCAUkECBSFegnBNSpoL9c4t-7QouoYuxnW3y3maSwYYiox2SXWP5fRNB4B-bRvV1-jGe-RzXq7AdCCw1uwIEwO-dwlz13OEEgGEIqzcqFLv9wC9Xn_9UQQs68fZu5-K/w648-h387/NADD.PNG&quot; width=&quot;648&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/form&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;Matrix Subtraction program&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;

&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;
&lt;textarea id=&quot;comments&quot; name=&quot;comments&quot; style=&quot;background-color: lightblue; border: none; color: black; font: 17px / 30px sans-serif; height: 1677px; margin: 0px; padding: 2%; width: 630px;&quot;&gt;//Matrix subtraction program in c language//

#include&quot;stdio.h&quot;
int main()
{
int A[10][10],B[10][10],C[10][10],i,k,row,col;
printf(&quot;Enter The Matrix row &amp; col = &quot;);
scanf(&quot;%d %d&quot;,&amp;row,&amp;col);
printf(&quot;Enter the First matrix :\n&quot;);
for(i=0;i&lt;row;i++)
{
 for (k=0;k&lt;col;k++)
{
printf(&quot;Enter matrix[%d][%d]=&quot;,i,k);
scanf(&quot;%d&quot;,&amp;A[i][k]);
}
}
printf(&quot;First matrix are:\n&quot;);
for(i=0;i&lt;row;i++)
{
 for (k=0;k&lt;col;k++)
{
printf(&quot;%d\t&quot;,A[i][k]);
}
printf(&quot;\n&quot;);
}
printf(&quot;Enter the Second matrix :\n&quot;);
for(i=0;i&lt;row;i++)
{
 for (k=0;k&lt;col;k++)
{
printf(&quot;Enter matrix[%d][%d]=&quot;,i,k);
scanf(&quot;%d&quot;,&amp;B[i][k]);
}
}
printf(&quot;Second matrix are:\n&quot;);
for(i=0;i&lt;row;i++)
{
 for (k=0;k&lt;col;k++)
{
printf(&quot;%d\t&quot;,B[i][k]);
}
printf(&quot;\n&quot;);
}
printf(&quot;Matrix sub are:\n&quot;);
for(i=0;i&lt;row;i++)
{
 for (k=0;k&lt;col;k++)
{
	C[i][k]=A[i][k]-B[i][k];
	printf(&quot;%d\t&quot;,C[i][k]);
}
printf(&quot;\n&quot;);
}
}&lt;/textarea&gt;&lt;br /&gt;&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;Output is:&amp;nbsp;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;Enter matrix[0][1]=4&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;Enter matrix[1][0]=8&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;Enter matrix[1][1]=5&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;Enter matrix[2][0]=9&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;Enter matrix[2][1]=7&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;First matrix are:&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;4&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;8&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;5&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;9&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;7&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;Enter the Second matrix :&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;Enter matrix[0][0]=1&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;Enter matrix[0][1]=0&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;Enter matrix[1][0]=2&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;Enter matrix[1][1]=3&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;Enter matrix[2][0]=03&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;Enter matrix[2][1]=12&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;Second matrix are:&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;12&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;Matrix sub are:&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;4&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;6&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;6&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;-5&lt;/form&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://ahvicoding.blogspot.com/feeds/3232552123754870604/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://ahvicoding.blogspot.com/2021/07/matrix-addition-and-subtraction-program.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/3172594483165237090/posts/default/3232552123754870604'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/3172594483165237090/posts/default/3232552123754870604'/><link rel='alternate' type='text/html' href='https://ahvicoding.blogspot.com/2021/07/matrix-addition-and-subtraction-program.html' title='Matrix Addition and subtraction program in C language '/><author><name>Ahvi</name><uri>http://www.blogger.com/profile/16050488529644377675</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwc4ymRsI-TiORGpYIrr6-h-9bh98NeUT5w9Hfrli9Do40uwdQ16K8Bg3yGVScW2XYtYFtqhXqwWS-0NKcNAC5GasqES7T6eIz-SIL9bZnXAEfJKemXJLYYsuO0HjuvxR5nV0OZGWF0SU5/s72-w611-h367-c/NASUB.PNG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3172594483165237090.post-4418303194947451732</id><published>2021-07-14T01:38:00.000-07:00</published><updated>2021-07-14T01:38:00.715-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Array"/><title type='text'> Matrix program or 2D Array in C language Transpose of Matrix program in C language </title><content type='html'>&lt;h1 style=&quot;text-align: left;&quot;&gt;&amp;nbsp;Matrix program or 2D Array in C language&amp;nbsp;&lt;/h1&gt;&lt;div&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;In C language ,A two dimensional array is also known as matrix .Today we will learn about Matrix&amp;nbsp; .We all know that we also use loop to define an array .We will create a matrix program using a nested for loop.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span style=&quot;color: #351c75; font-size: large;&quot;&gt;1.Matrix program in C language:&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span style=&quot;color: #351c75; font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;

&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;
&lt;textarea id=&quot;comments&quot; name=&quot;comments&quot; style=&quot;background-color: lightblue; border: none; color: black; font: 18px / 30px sans-serif; height: 861px; margin: 0px; padding: 2%; width: 621px;&quot;&gt;/*MATRIX PROGRAM*/
#include&quot;stdio.h&quot;
int main()
{
	int a[10][10];
	int r,c,k,l;
	printf(&quot;ENTER THE ROW AND COL:&quot;);
	scanf(&quot;%d %d&quot;,&amp;r,&amp;c);
	printf(&quot;ENTER THE MATRIX ELEMENTS:&quot;);
	for(k=0;k&lt;r;k++)
	{
		for(l=0;l&lt;c;l++)
		{
			printf(&quot;ENTER a[%d][%d] : &quot;,k,l);
			scanf(&quot;%d&quot;,&amp;a[k][l]);
		}
	}
	printf(&quot;MATRIX ARE: \n&quot;);
	for(k=0;k&lt;r;k++)
	{
		for(l=0;l&lt;c;l++)
		{
			printf(&quot;%d\t&quot;,a[k][l]);
		}
		printf(&quot;\n&quot;);
	}
}&lt;/textarea&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #351c75; font-size: large;&quot;&gt;&lt;b&gt;Output are:&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;ENTER THE ROW AND COL:2&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;3&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;ENTER THE MATRIX ELEMENTS:ENTER a[0][0] : 2&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;ENTER a[0][1] : 5&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;ENTER a[0][2] : 7&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;ENTER a[1][0] : 8&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;ENTER a[1][1] : 6&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;ENTER a[1][2] : 1&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;MATRIX ARE:&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;5&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;7&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;8&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;6&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/form&gt;&lt;h1&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;&lt;span style=&quot;color: #351c75; font-size: large;&quot;&gt;2.Transpose of matrix in C language:&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-large;&quot;&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;&amp;nbsp; &amp;nbsp; Matrix&lt;/span&gt;&lt;span style=&quot;color: #351c75; font-weight: 400;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;&amp;nbsp;a&lt;/span&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; color: #351c75; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1N1VCP_Bp3NPMephXEdaEoBUb6pxBejfwF-_y3S2m9de4a2Azl_Pgv09XjBMqkQbsCSLhiVLGBsVqif_8AtEP-SRnfghyKUFH8pwrPaxlfHhnDiYbM3_NeQ2qSM9PkkrbbDLzjlJzeLFx/s380/c.PNG&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;281&quot; data-original-width=&quot;380&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1N1VCP_Bp3NPMephXEdaEoBUb6pxBejfwF-_y3S2m9de4a2Azl_Pgv09XjBMqkQbsCSLhiVLGBsVqif_8AtEP-SRnfghyKUFH8pwrPaxlfHhnDiYbM3_NeQ2qSM9PkkrbbDLzjlJzeLFx/s320/c.PNG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;span style=&quot;color: #0c343d;&quot;&gt;a[0][0]= 4,&amp;nbsp; &amp;nbsp;a[0][1]=1,&amp;nbsp; &amp;nbsp;a[0][2]=8:&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;span style=&quot;color: #0c343d;&quot;&gt;a[1][0]= 9,&amp;nbsp; &amp;nbsp;a[1][1]=0,&amp;nbsp; &amp;nbsp;a[1][2]=5:&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;span style=&quot;color: #0c343d;&quot;&gt;a[2][0]= 7,&amp;nbsp; &amp;nbsp;a[2][1]=3,&amp;nbsp; &amp;nbsp;a[2][2]=2:&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; color: #351c75; text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;&amp;nbsp; &amp;nbsp; Transpose of Matrix&amp;nbsp;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLTbTKxA-wzKah7Gbv3J4wjCHfUgk5g93ShBSvQVpoOMBbg12wjCGNLOq2zVHrbtgKLtxxshrzcagWbdouMI9kPu8cIrSUCOwgc4K6I3F9e36d-1GdagKLfLVBLIQHh4dTeo_5UG04xEbi/s408/c2.PNG&quot; style=&quot;margin-left: 1em; margin-right: 1em; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;343&quot; data-original-width=&quot;408&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLTbTKxA-wzKah7Gbv3J4wjCHfUgk5g93ShBSvQVpoOMBbg12wjCGNLOq2zVHrbtgKLtxxshrzcagWbdouMI9kPu8cIrSUCOwgc4K6I3F9e36d-1GdagKLfLVBLIQHh4dTeo_5UG04xEbi/s320/c2.PNG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; font-size: x-large;&quot;&gt;&lt;span style=&quot;color: #0c343d;&quot;&gt;a[0][0]=4, a[1][0]=9, a[2][0]=7:&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; font-size: x-large;&quot;&gt;&lt;span style=&quot;color: #0c343d;&quot;&gt;a[0][1]=1, a[1][1]=0, a[2][1]=3:&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; font-size: x-large;&quot;&gt;&lt;span style=&quot;color: #0c343d;&quot;&gt;a[0][2]=8, a[1][2]=5, a[2][2]=2:&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; font-size: x-large;&quot;&gt;&lt;span style=&quot;color: #0c343d;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; font-size: x-large;&quot;&gt;&lt;span style=&quot;color: #0c343d;&quot;&gt;Here the index of the row in the matrix a is being exchanged with the index of the column.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; font-size: x-large;&quot;&gt;&lt;span style=&quot;color: #0c343d;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; font-size: x-large;&quot;&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;PROGRAM ARE:&lt;/span&gt;&lt;/div&gt;&lt;/form&gt;&lt;/h1&gt;


&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;
&lt;textarea id=&quot;comments&quot; name=&quot;comments&quot; style=&quot;background-color: lightblue; border: none; color: black; font: 18px / 30px sans-serif; height: 1021px; margin: 0px; padding: 2%; width: 590px;&quot;&gt;#include&quot;stdio.h&quot;
int main()
{
	int A[10][10],i,k,r,c;
	printf(&quot;Enter the matrix row &amp; col:&quot;);
	scanf(&quot;%d %d&quot;,&amp;r,&amp;c);
	for(i=0;i&lt;r;i++)
	{
		for(k=0;k&lt;c;k++)
		{
			printf(&quot;Enter A[%d][%d] =&quot;,i,k);
			scanf(&quot;%d&quot;,&amp;A[i][k]);
		}
	}
	printf(&quot;Matrix are:\n&quot;);
	for(i=0;i&lt;r;i++)
	{
		for(k=0;k&lt;c;k++)
		{
			printf(&quot;%d\t&quot;,A[i][k]);
		}
		printf(&quot;\n&quot;);
	}
	printf(&quot;Transpose of matrix are:\n&quot;);
	for(i=0;i&lt;c;i++)
	{
		for(k=0;k&lt;r;k++)
		{
			printf(&quot;%d\t&quot;,A[k][i]);
		}
		printf(&quot;\n&quot;);
	}
}&lt;/textarea&gt;&lt;br /&gt;In C language&lt;br /&gt;&lt;b&gt;&lt;span style=&quot;color: #351c75; font-size: medium;&quot;&gt;&lt;br /&gt;OUTPUT ARE:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Enter the matrix row &amp;amp; col:3&lt;/span&gt;&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;2&lt;/span&gt;&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Enter A[0][0] =4&lt;/span&gt;&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Enter A[0][1] =5&lt;/span&gt;&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Enter A[1][0] =6&lt;/span&gt;&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Enter A[1][1] =1&lt;/span&gt;&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Enter A[2][0] =2&lt;/span&gt;&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Enter A[2][1] =3&lt;/span&gt;&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Matrix are:&lt;/span&gt;&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;5&lt;/span&gt;&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;6&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&lt;/span&gt;&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3&lt;/span&gt;&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Transpose of matrix are:&lt;/span&gt;&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;6&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&lt;/span&gt;&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;5&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/form&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='https://ahvicoding.blogspot.com/feeds/4418303194947451732/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://ahvicoding.blogspot.com/2021/07/matrix-program-or-2d-array-in-c.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/3172594483165237090/posts/default/4418303194947451732'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/3172594483165237090/posts/default/4418303194947451732'/><link rel='alternate' type='text/html' href='https://ahvicoding.blogspot.com/2021/07/matrix-program-or-2d-array-in-c.html' title=' Matrix program or 2D Array in C language Transpose of Matrix program in C language '/><author><name>Ahvi</name><uri>http://www.blogger.com/profile/16050488529644377675</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1N1VCP_Bp3NPMephXEdaEoBUb6pxBejfwF-_y3S2m9de4a2Azl_Pgv09XjBMqkQbsCSLhiVLGBsVqif_8AtEP-SRnfghyKUFH8pwrPaxlfHhnDiYbM3_NeQ2qSM9PkkrbbDLzjlJzeLFx/s72-c/c.PNG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3172594483165237090.post-6028703722474965011</id><published>2021-07-14T00:02:00.001-07:00</published><updated>2021-07-14T00:02:31.813-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Advanced C"/><title type='text'>Age calculating through date of birth program in C language</title><content type='html'>

&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot; style=&quot;text-align: left;&quot;&gt;&lt;b&gt;&lt;span&gt;&lt;span style=&quot;font-size: x-large;&quot;&gt;DATE OF BIRTH PROGRAM IN C LANGUAGE&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #351c75; font-size: large;&quot;&gt;&amp;nbsp;Today&#39;s date - your date of birth = your current age&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;There are fifth condition are happening..&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;@1.IF today date 13.7.2021 and date of birth 15.9.2001 age are (2021-2001).(7-9).(13-15) = 20.-2.-2&amp;nbsp; &amp;nbsp;but it&#39;s wrong real age will be 19year.9month.28days .Then first condition will be (days &amp;lt; 0)&amp;amp;&amp;amp;(month&amp;lt;0)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;@2.IF today date 13.7.2021 and date of birth&amp;nbsp;12.9.2001 age are(2021-2001).(7-9).(13-12) = 20.-2.1 but it&#39;s wrong real age will be 19 year . 10 month . 1 days .Then&amp;nbsp; second condition will be (days&amp;gt;0)&amp;amp;&amp;amp;(month&amp;lt;0).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;@3.IF today date 13.7.2021 and date of birth 13.9.2001 age are(2021-2001).(7-9).(13-13) = 20.-2.0 but it&#39;s wrong real age will be 19 year . 10 month . 0days .Then&amp;nbsp; third condition will be (days==0)&amp;amp;&amp;amp;(month&amp;lt;0).&lt;br /&gt;&lt;br /&gt;@4.IF today date 13.7.2021 and date of birth 13.9.2001 age are(2021-2001).(7-9).(13-13) = 20.1.0 but it&#39;s wrong real age will be 19 year . 10 month . 0days .Then&amp;nbsp; fourth condition will be (days&amp;lt;=0)&amp;amp;&amp;amp;(month&amp;gt;=0).&lt;br /&gt;&lt;br /&gt;@5.IF today date 13.7.2021 and date of birth 15.6.2001 age are(2021-2001).(7-6).(13-13) = 20.1.but it&#39;s wrong real age will be 19 year . 10 month . 0days .Then&amp;nbsp; fourth condition will be (days&amp;lt;0)&amp;amp;&amp;amp;(month&amp;gt;=0).&lt;br /&gt;&lt;br /&gt;In C language&amp;nbsp;&lt;br /&gt;&amp;nbsp;IF STATEMENT SYNTAX&amp;nbsp; IN THIS PROGRAM&lt;br /&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;if(condition)&lt;br /&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;{&lt;br /&gt;&amp;nbsp;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;if(condition)&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;br /&gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; statements;&lt;br /&gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;}&lt;br /&gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp; }&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;b&gt;&lt;span style=&quot;color: #20124d; font-size: large;&quot;&gt;PROGRAM&lt;/span&gt;&lt;/b&gt;&lt;/form&gt;

&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;
&lt;textarea id=&quot;comments&quot; name=&quot;comments&quot; style=&quot;background-color: lightblue; border: none; color: black; font: 16px / 30px sans-serif; height: 1548px; margin: 0px; padding: 2%; width: 642px;&quot;&gt;#include&quot;stdio.h&quot;
int main()
{
	int Y,M,D,y,m,d,a,b,c,k,l,p;
	printf(&quot;Enter your date of birth(DD.MM.YY):&quot;);
	scanf(&quot;%d %d %d&quot;,&amp;D,&amp;M,&amp;Y);
	printf(&quot;Enter the today date(DD.MM.YY):&quot;);
	scanf(&quot; %d %d %d&quot;,&amp;d,&amp;m,&amp;y);
	a=d-D;//a is difference between days//
	b=m-M;//b is difference between months//
	c=y-Y;//c is difference between years//
	if(a&lt;0)
	{
		if(b&lt;0)
		{
			k=30+a,l=12+b-1,p=c-1;
			printf(&quot;YOUR AGE ARE :%d DAYS %d MOMTH %d YEAR&quot;,k,l,p);
		}
		if(b==0)
		{
			k=30+a,l=12-1,p=c-1;
			printf(&quot;YOUR AGE ARE :%d DAYS %d MOMTH %d YEAR&quot;,k,l,p);
		}
		if(b&gt;0)
		{
			k=30+a,l=b-1,p=c;
			printf(&quot;YOUR AGE ARE :%d DAYS %d MOMTH %d YEAR&quot;,k,l,p);
		}
	}
	if(a&gt;=0)
	{
		if(b&lt;0)
		{
			k=a,l=12+b,p=c-1;
			printf(&quot;YOUR AGE ARE :%d DAYS %d MOMTH %d YEAR&quot;,k,l,p);
		}
		if(b&gt;=0)
		{
			k=a,l=b,p=c;
			printf(&quot;YOUR AGE ARE :%d DAYS %d MOMTH %d YEAR&quot;,k,l,p);
		}
		
	}		
}&lt;/textarea&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &lt;span style=&quot;color: #20124d; font-size: large;&quot;&gt;&lt;b&gt;OUTPUT ARE :&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #20124d;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #20124d; font-size: medium;&quot;&gt;Enter your date of birth(DD.MM.YY):15&lt;/span&gt;&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;&lt;span style=&quot;color: #20124d; font-size: medium;&quot;&gt;6&lt;/span&gt;&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;&lt;span style=&quot;color: #20124d; font-size: medium;&quot;&gt;2002&lt;/span&gt;&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;&lt;span style=&quot;color: #20124d; font-size: medium;&quot;&gt;Enter the today date(DD.MM.YY):14&lt;/span&gt;&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;&lt;span style=&quot;color: #20124d; font-size: medium;&quot;&gt;7&lt;/span&gt;&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;&lt;span style=&quot;color: #20124d; font-size: medium;&quot;&gt;2021&lt;/span&gt;&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;&lt;span style=&quot;color: #20124d; font-size: medium;&quot;&gt;YOUR AGE ARE :29 DAYS 0 MOMTH 19 YEAR&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/form&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='https://ahvicoding.blogspot.com/feeds/6028703722474965011/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://ahvicoding.blogspot.com/2021/07/age-calculating-through-date-of-birth.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/3172594483165237090/posts/default/6028703722474965011'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/3172594483165237090/posts/default/6028703722474965011'/><link rel='alternate' type='text/html' href='https://ahvicoding.blogspot.com/2021/07/age-calculating-through-date-of-birth.html' title='Age calculating through date of birth program in C language'/><author><name>Ahvi</name><uri>http://www.blogger.com/profile/16050488529644377675</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3172594483165237090.post-7277298065299532828</id><published>2021-07-13T09:06:00.004-07:00</published><updated>2021-07-13T09:35:24.636-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Basic programs"/><title type='text'>Arithmetic program in C language || Calculator program in C language</title><content type='html'>&lt;p&gt;&amp;nbsp;&lt;span style=&quot;color: #20124d; font-size: x-large;&quot;&gt;&lt;i&gt;&lt;b&gt;Calculator&amp;nbsp; program in C language .&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;First of all let us know its logic .how is this working . Now let&#39;s see it&#39;s process . In C language , %d is used to define it&#39;s integers and %f is used to define it&#39;s floats. In C language , the (+) sign is used as a plus , the (-) sign used as a minus , the (*) sign is used for multiplies and the (/) sign is used for division.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; %0.2f it means any float value like 52.987 = 52.98.it show only 2 place of the decimal.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: x-large;&quot;&gt;&lt;u&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;&lt;b&gt;PROGRAM&lt;/b&gt;&lt;/span&gt;&amp;nbsp;&lt;/u&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;&amp;nbsp;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/p&gt;



&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;
&lt;textarea id=&quot;comments&quot; name=&quot;comments&quot; style=&quot;background-color: lightblue; border: none; color: black; font: 18px / 30px sans-serif; height: 1267px; margin: 0px; padding: 2%; width: 614px;&quot;&gt;/*ARITHMETIC PROGRAM IN C LANGUAGE*/
#include&quot;stdio.h&quot;
int main()
{
	float a,b,sum,sub,mult,div ;
	char sign;
	printf(&quot;SELECT ANY SIGN (+ - * / ) :&quot;);
	scanf(&quot;%c&quot;,&amp;sign);
	printf(&quot;ENTER THE FIRST NUMERIC VALUE:&quot;);
	scanf(&quot;%f&quot;,&amp;a);
	printf(&quot;ENTER THE SECOND NUMERIC VALUE:&quot;);
	scanf(&quot;%f&quot;,&amp;b);
	switch(sign)
	{
		case &#39;+&#39;: 
		{
			sum= a+b;
			printf(&quot;addition are: %0.2f&quot;,sum);
			break;
		}
		case &#39;-&#39;:
		{
			sub=a-b;
			printf(&quot;subtraction are: %0.2f&quot;,sub);
			break;
		}
		case &#39;*&#39;:
		{
			mult=a*b;
			printf(&quot;multiplation are: %0.2f&quot;,mult);
			break;
		}
		case &#39;/&#39;:
		{
			div=a/b;
			printf(&quot;division are: %0.2f&quot;,div);
			break;
		}
	}
}&lt;/textarea&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #351c75; font-size: large;&quot;&gt;&lt;b&gt;&lt;u&gt;OUTPUT ARE:&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;SELECT ANY SIGN (+ - * / ) :+&lt;/span&gt;&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;ENTER THE FIRST NUMERIC VALUE:7&lt;/span&gt;&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;ENTER THE SECOND NUMERIC VALUE:3&lt;/span&gt;&lt;/form&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;addition are: 10.00&lt;/span&gt;&lt;/form&gt;


&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;
&lt;textarea id=&quot;comments&quot; name=&quot;comments&quot; style=&quot;background-color: lightblue; border: none; color: black; font: 18px / 30px sans-serif; height: 227px; margin: 0px; padding: 2%; width: 512px;&quot;&gt;SELECT ANY SIGN (+ - * / ) :+
ENTER THE FIRST NUMERIC VALUE:7
ENTER THE SECOND NUMERIC VALUE:3
addition are: 10.00&lt;/textarea&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/form&gt;&lt;p&gt;&lt;/p&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot; style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/form&gt;&lt;p&gt;&lt;/p&gt;&lt;form action=&quot;/html/tags/html_form_tag_action.cfm&quot; method=&quot;post&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;/form&gt;</content><link rel='replies' type='application/atom+xml' href='https://ahvicoding.blogspot.com/feeds/7277298065299532828/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://ahvicoding.blogspot.com/2021/07/arithmetic-program-in-c-language.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/3172594483165237090/posts/default/7277298065299532828'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/3172594483165237090/posts/default/7277298065299532828'/><link rel='alternate' type='text/html' href='https://ahvicoding.blogspot.com/2021/07/arithmetic-program-in-c-language.html' title='Arithmetic program in C language || Calculator program in C language'/><author><name>Ahvi</name><uri>http://www.blogger.com/profile/16050488529644377675</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3172594483165237090.post-1082391343216853538</id><published>2021-07-05T06:57:00.001-07:00</published><updated>2021-07-05T06:57:10.279-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Array"/><category scheme="http://www.blogger.com/atom/ns#" term="Basic programs"/><title type='text'>Two dimensional array in C language or matrix program in c language</title><content type='html'>&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;&amp;nbsp;Two dimensional arrays:&lt;/span&gt;&lt;/h1&gt;&lt;div&gt;&lt;span style=&quot;font-size: x-large;&quot;&gt;1.Two dimensional array is known as matrix.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size: x-large;&quot;&gt;2.An array with two subscripts is termed as two-dimensional array.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size: large;&quot;&gt;3.We know that a one dimensional array can store a row of elements, so a two-dimensional array enables us to store multiple roes of elements.&lt;br /&gt;&lt;/span&gt;&lt;h4 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: #674ea7; font-size: large;&quot;&gt;The syntax of declaring a two-dimensional array is :&lt;/span&gt;&lt;/h4&gt;&lt;h4 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;Data-type array name[row][column];&lt;/span&gt;&lt;/h4&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: red; font-size: large;&quot;&gt;&lt;i&gt;&lt;b&gt;For reading value :&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;i&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;i&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: large;&quot;&gt;for(k=0;k&amp;lt;4;k++)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: large;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: large;&quot;&gt;for(l=0;l&amp;lt;3;l++)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: large;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: large;&quot;&gt;scanf(&quot;%d&quot;,&amp;amp;a[k][l]);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: large;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: large;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;i style=&quot;font-size: x-large;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;For displaying value :&lt;/span&gt;&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i style=&quot;font-size: x-large;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i style=&quot;font-size: x-large;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span style=&quot;font-size: large;&quot;&gt;for(k=0;k&amp;lt;4;k++)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: large;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: large;&quot;&gt;for(l=0;l&amp;lt;3;l++)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: large;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: large;&quot;&gt;printf(&quot;%d&quot;,a[k][l]);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: large;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: large;&quot;&gt;printf(&quot;\n&quot;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: large;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #38761d; font-size: large;&quot;&gt;&lt;i&gt;&lt;b&gt;Simple Matrix Program :&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;i&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;div&gt;#include&quot;stdio.h&quot;&lt;/div&gt;&lt;div&gt;int main()&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;int a[3][3];&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;int k,l;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;printf(&quot;Enter the array elements: \n&quot;);&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;for(k=0;k&amp;lt;3;k++)&amp;nbsp; //for reading value//&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;for(l=0;l&amp;lt;3;l++)&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;printf(&quot;Enter a[%d][%d] :&quot;,k,l);&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;scanf(&quot;%d&quot;,&amp;amp;a[k][l]);&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;printf(&quot;\n\nMatrix are: \n&quot;);&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;for(k=0;k&amp;lt;3;k++)&amp;nbsp; //for displaying value//&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;for(l=0;l&amp;lt;3;l++)&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;printf(&quot;%d\t&quot;,a[k][l]);&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;printf(&quot;\n&quot;);&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;}&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;Output are:&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;Enter the array elements:&lt;/div&gt;&lt;div&gt;Enter a[0][0] :1&lt;/div&gt;&lt;div&gt;Enter a[0][1] :4&lt;/div&gt;&lt;div&gt;Enter a[0][2] :5&lt;/div&gt;&lt;div&gt;Enter a[1][0] :7&lt;/div&gt;&lt;div&gt;Enter a[1][1] :12&lt;/div&gt;&lt;div&gt;Enter a[1][2] :8&lt;/div&gt;&lt;div&gt;Enter a[2][0] :96&lt;/div&gt;&lt;div&gt;Enter a[2][1] :10&lt;/div&gt;&lt;div&gt;Enter a[2][2] :3&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Matrix are:&lt;/div&gt;&lt;div&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;5&lt;/div&gt;&lt;div&gt;7&amp;nbsp; &amp;nbsp; &amp;nbsp; 12&amp;nbsp; &amp;nbsp; &amp;nbsp; 8&lt;/div&gt;&lt;div&gt;96&amp;nbsp; &amp;nbsp; 10&amp;nbsp; &amp;nbsp; &amp;nbsp; 3&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;font-style: italic; font-weight: bold;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://ahvicoding.blogspot.com/feeds/1082391343216853538/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://ahvicoding.blogspot.com/2021/07/two-dimensional-array-in-c-language-or.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/3172594483165237090/posts/default/1082391343216853538'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/3172594483165237090/posts/default/1082391343216853538'/><link rel='alternate' type='text/html' href='https://ahvicoding.blogspot.com/2021/07/two-dimensional-array-in-c-language-or.html' title='Two dimensional array in C language or matrix program in c language'/><author><name>Ahvi</name><uri>http://www.blogger.com/profile/16050488529644377675</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3172594483165237090.post-4859098592086596261</id><published>2021-07-04T21:53:00.001-07:00</published><updated>2021-07-04T21:53:51.460-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Array"/><title type='text'>One dimensional  array declaration in c language basic of array</title><content type='html'>&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;i&gt;&lt;span style=&quot;color: #0f50d3; font-size: x-large;&quot;&gt;One D array&lt;/span&gt;&lt;/i&gt;&lt;/h1&gt;&lt;h4 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: #a21d1d; font-size: medium;&quot;&gt;**Definition of array**&lt;/span&gt;&lt;/h4&gt;&lt;div&gt;&lt;span style=&quot;color: #38761d; font-size: medium;&quot;&gt;Array can be define as a collection of data object which are stored in consecutive memory location with a common variable name.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #38761d; font-size: medium;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp;or&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #38761d; font-size: medium;&quot;&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Array is the collection of similar data types or collection of similar entity stored in contiguous memory location&lt;/span&gt;.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;h4 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: #8e1111; font-size: medium;&quot;&gt;**Initialization of array**&lt;/span&gt;&lt;/h4&gt;&lt;div&gt;&lt;ol style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;span style=&quot;color: #800180; font-size: medium;&quot;&gt;Array can be made initialization at the time of declaration itself.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;color: #800180; font-size: medium;&quot;&gt;The general form of array initialization is as below&amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;span&gt;1.Data type array name[size]&lt;/span&gt;&lt;/h3&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;span&gt;2.&lt;/span&gt;Data type array name[size]={element1,element2,element3,.....}&lt;/h3&gt;&lt;div&gt;&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;Example:&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;b&gt;&lt;span style=&quot;color: red; font-size: medium;&quot;&gt;int a[[4]={1,5,8,4}&lt;/span&gt;&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;b&gt;&lt;span style=&quot;color: red; font-size: medium;&quot;&gt;char d[3]={&#39;A&#39;,&#39;R&#39;,u&#39;}&lt;/span&gt;&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;&lt;span style=&quot;color: #800180; font-size: medium;&quot;&gt;Program&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;span style=&quot;color: #4c1130; font-size: medium;&quot;&gt;#include&quot;stdio.h&quot;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #4c1130; font-size: medium;&quot;&gt;int main()&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #4c1130; font-size: medium;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #4c1130; font-size: medium;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;int a[100],i,n;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #4c1130; font-size: medium;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;printf(&quot;Enter the number of elements : &quot;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #4c1130; font-size: medium;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;scanf(&quot;%d&quot;,&amp;amp;n);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #4c1130; font-size: medium;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;printf(&quot;Enter the elements\n&quot;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #4c1130; font-size: medium;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;for(i=0;i&amp;lt;n;i++)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #4c1130; font-size: medium;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #4c1130; font-size: medium;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;printf(&quot;Entre the a[%d] : &quot;,i);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #4c1130; font-size: medium;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;scanf(&quot;%d&quot;,&amp;amp;a[i]);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #4c1130; font-size: medium;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #4c1130; font-size: medium;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;//show one-d array//&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #4c1130; font-size: medium;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;printf(&quot;1-D Array are:\n&quot;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #4c1130; font-size: medium;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;for(i=0;i&amp;lt;n;i++)&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #4c1130; font-size: medium;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #4c1130; font-size: medium;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;printf(&quot;%d \t &quot;,a[i]);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #4c1130; font-size: medium;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #4c1130; font-size: medium;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;i style=&quot;color: #800180; font-size: large;&quot;&gt;&lt;b&gt;Output are:&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;i&gt;&lt;span style=&quot;color: #351c75; font-size: medium;&quot;&gt;Enter the number of elements : 5&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span style=&quot;color: #351c75; font-size: medium;&quot;&gt;Enter the elements&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span style=&quot;color: #351c75; font-size: medium;&quot;&gt;Entre the a[0] : 4&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span style=&quot;color: #351c75; font-size: medium;&quot;&gt;Entre the a[1] : 7&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span style=&quot;color: #351c75; font-size: medium;&quot;&gt;Entre the a[2] : 8&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span style=&quot;color: #351c75; font-size: medium;&quot;&gt;Entre the a[3] : 89&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span style=&quot;color: #351c75; font-size: medium;&quot;&gt;Entre the a[4] : 1&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span style=&quot;color: #351c75; font-size: medium;&quot;&gt;1-D Array are:&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span style=&quot;color: #351c75; font-size: medium;&quot;&gt;4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 7&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;8&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;89&amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span style=&quot;color: #351c75; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;&lt;span style=&quot;color: #800180; font-size: medium;&quot;&gt;Program&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span style=&quot;color: #4c1130; font-size: medium;&quot;&gt;#include&quot;stdio.h&quot;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #4c1130; font-size: medium;&quot;&gt;int main()&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #4c1130; font-size: medium;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #4c1130; font-size: medium;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;int a[6]={23,4,56,45,32,3};&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #4c1130; font-size: medium;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;printf(&quot;Array are:\n&quot;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #4c1130; font-size: medium;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;for(int i=0;i&amp;lt;6;i++)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #4c1130; font-size: medium;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #4c1130; font-size: medium;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;printf(&quot;%d\t&quot;,a[i]);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #4c1130; font-size: medium;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #4c1130; font-size: medium;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #800180; font-size: medium;&quot;&gt;&lt;i&gt;&lt;b&gt;Output are:&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #800180; font-size: medium;&quot;&gt;&lt;i&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: red; font-size: medium;&quot;&gt;&lt;i&gt;&lt;div&gt;Array are:&lt;/div&gt;&lt;div&gt;23&amp;nbsp; &amp;nbsp; &amp;nbsp; 4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;56&amp;nbsp; &amp;nbsp; &amp;nbsp; 45&amp;nbsp; &amp;nbsp; &amp;nbsp; 32&amp;nbsp; &amp;nbsp; &amp;nbsp; 3&lt;/div&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h4 style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/h4&gt;</content><link rel='replies' type='application/atom+xml' href='https://ahvicoding.blogspot.com/feeds/4859098592086596261/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://ahvicoding.blogspot.com/2021/07/one-dimensional-array-declaration-in-c.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/3172594483165237090/posts/default/4859098592086596261'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/3172594483165237090/posts/default/4859098592086596261'/><link rel='alternate' type='text/html' href='https://ahvicoding.blogspot.com/2021/07/one-dimensional-array-declaration-in-c.html' title='One dimensional  array declaration in c language basic of array'/><author><name>Ahvi</name><uri>http://www.blogger.com/profile/16050488529644377675</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3172594483165237090.post-1068677347257315074</id><published>2021-07-04T08:58:00.004-07:00</published><updated>2021-07-04T08:58:52.073-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Basic programs"/><category scheme="http://www.blogger.com/atom/ns#" term="Function"/><title type='text'>Types of Function in C language return type function (argument)  use</title><content type='html'>&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;&amp;nbsp;Function use example:&lt;/span&gt;&lt;/h1&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;1. Function with no argument (parameters) &amp;amp; no return value:&lt;/span&gt;&lt;/h3&gt;&lt;div&gt;&lt;i&gt;&lt;b&gt;&lt;span style=&quot;color: #800180;&quot;&gt;Basic example program addition&lt;/span&gt;&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #2b00fe;&quot;&gt;&lt;b&gt;#include&amp;lt;stdio.h&amp;gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #2b00fe;&quot;&gt;&lt;b&gt;void add(void);&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #2b00fe;&quot;&gt;&lt;b&gt;int main()&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #2b00fe;&quot;&gt;&lt;b&gt;{&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #2b00fe;&quot;&gt;&lt;b&gt;add();&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #2b00fe;&quot;&gt;&lt;b&gt;}&lt;br /&gt;void add()&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #2b00fe;&quot;&gt;&lt;b&gt;{&lt;br /&gt;int x,y=56,z=45;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #2b00fe;&quot;&gt;&lt;b&gt;x=y+z;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #2b00fe;&quot;&gt;&lt;b&gt;printf(&quot;ADD=%d&quot;,x);&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #2b00fe;&quot;&gt;&lt;b&gt;}&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: red; font-size: medium;&quot;&gt;&lt;b&gt;&lt;i&gt;Output are:&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: red; font-size: medium;&quot;&gt;&lt;b&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ffa400;&quot;&gt;&lt;b&gt;ADD=101&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: #134f5c;&quot;&gt;2.&lt;/span&gt;&lt;span style=&quot;color: #274e13;&quot;&gt; Function with no argument but return type:&lt;/span&gt;&lt;/h3&gt;&lt;div&gt;&lt;span style=&quot;color: #990000;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;i&gt;Here called function is independent and are initialized . The value aren&#39;t passed by The calling function .Here the calling function and called function are communicated party with each other.&lt;/i&gt;&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #990000;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;&lt;span style=&quot;color: #800180;&quot;&gt;Basic example program addition&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #2b00fe;&quot;&gt;&lt;b&gt;#include&amp;lt;stdio.h&amp;gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #2b00fe;&quot;&gt;&lt;b&gt;int&amp;nbsp; add(void);&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #2b00fe;&quot;&gt;&lt;b&gt;int main()&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #2b00fe;&quot;&gt;&lt;b&gt;{&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #2b00fe;&quot;&gt;&lt;b&gt;add();&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #2b00fe;&quot;&gt;&lt;b&gt;}&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #2b00fe;&quot;&gt;&lt;b&gt;int add(void)&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #2b00fe;&quot;&gt;&lt;b&gt;{&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span style=&quot;color: #2b00fe;&quot;&gt;&lt;b&gt;int x,y=56,z=45;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #2b00fe;&quot;&gt;&lt;b&gt;x=y+z;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #2b00fe;&quot;&gt;&lt;b&gt;printf(&quot;ADD=%d&quot;,x);&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #2b00fe;&quot;&gt;&lt;b&gt;}&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #2b00fe;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span style=&quot;color: red; font-size: medium;&quot;&gt;&lt;b&gt;&lt;i&gt;Output are:&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: red; font-size: medium;&quot;&gt;&lt;b&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ffa400;&quot;&gt;&lt;b&gt;ADD=101&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;3. Function with argument but no return value&lt;/span&gt;&lt;/h3&gt;&lt;div&gt;&lt;span style=&quot;color: #990000; font-size: medium;&quot;&gt;&lt;i&gt;Here the function have argument so the calling function send date to the called function but called function dose not return value. Here the result obtained by the called function.&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #990000; font-size: medium;&quot;&gt;&lt;i&gt;&amp;nbsp;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;&lt;span style=&quot;color: #800180;&quot;&gt;Basic example program addition&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;b&gt;&lt;span style=&quot;color: #2b00fe;&quot;&gt;#include&amp;lt;stdio.h&amp;gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span style=&quot;color: #2b00fe;&quot;&gt;void add(int y,int z);&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span style=&quot;color: #2b00fe;&quot;&gt;int main()&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span style=&quot;color: #2b00fe;&quot;&gt;{&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span style=&quot;color: #2b00fe;&quot;&gt;int a,b;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span style=&quot;color: #2b00fe;&quot;&gt;add(a,b);&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span style=&quot;color: #2b00fe;&quot;&gt;}&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span style=&quot;color: #2b00fe;&quot;&gt;void add(int y,int z)&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span style=&quot;color: #2b00fe;&quot;&gt;{&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span style=&quot;color: #2b00fe;&quot;&gt;int x;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span style=&quot;color: #2b00fe;&quot;&gt;y=56,z=45;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span style=&quot;color: #2b00fe;&quot;&gt;x=y+z;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span style=&quot;color: #2b00fe;&quot;&gt;printf(&quot;ADD=%d&quot;,x);&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span style=&quot;color: #2b00fe;&quot;&gt;}&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span style=&quot;color: #2b00fe;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span style=&quot;color: red; font-size: medium;&quot;&gt;&lt;b&gt;&lt;i&gt;Output are:&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: red; font-size: medium;&quot;&gt;&lt;b&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ffa400;&quot;&gt;&lt;b&gt;ADD=101&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;4.Function with argument but return value&lt;/span&gt;&lt;/h3&gt;&lt;div&gt;&lt;span style=&quot;color: #990000; font-size: medium;&quot;&gt;&lt;i&gt;Here the calling function has the argument to pass to the called function and the called function returned value to the calling function.&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #990000; font-size: medium;&quot;&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span style=&quot;color: #800180;&quot;&gt;&lt;i&gt;&lt;b&gt;Basic example program addition&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;b&gt;&lt;span style=&quot;color: #2b00fe;&quot;&gt;#include&amp;lt;stdio.h&amp;gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span style=&quot;color: #2b00fe;&quot;&gt;int&amp;nbsp; add(int y,int z);&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span style=&quot;color: #2b00fe;&quot;&gt;int main()&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span style=&quot;color: #2b00fe;&quot;&gt;{&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span style=&quot;color: #2b00fe;&quot;&gt;int a,b,c;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span style=&quot;color: #2b00fe;&quot;&gt;c=add(a,b);&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span style=&quot;color: #2b00fe;&quot;&gt;printf(&quot;ADD=%d&quot;,c);&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span style=&quot;color: #2b00fe;&quot;&gt;}&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span style=&quot;color: #2b00fe;&quot;&gt;int add(int y,int z)&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span style=&quot;color: #2b00fe;&quot;&gt;{&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span style=&quot;color: #2b00fe;&quot;&gt;int x;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span style=&quot;color: #2b00fe;&quot;&gt;y=56,z=45;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span style=&quot;color: #2b00fe;&quot;&gt;x=y+z;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span style=&quot;color: #2b00fe;&quot;&gt;return x;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span style=&quot;color: #2b00fe;&quot;&gt;}&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span style=&quot;color: red; font-size: medium;&quot;&gt;&lt;b&gt;&lt;i&gt;Output are:&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: red; font-size: medium;&quot;&gt;&lt;b&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ffa400;&quot;&gt;&lt;b&gt;ADD=101&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://ahvicoding.blogspot.com/feeds/1068677347257315074/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://ahvicoding.blogspot.com/2021/07/types-of-function-in-c-language-return.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/3172594483165237090/posts/default/1068677347257315074'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/3172594483165237090/posts/default/1068677347257315074'/><link rel='alternate' type='text/html' href='https://ahvicoding.blogspot.com/2021/07/types-of-function-in-c-language-return.html' title='Types of Function in C language return type function (argument)  use'/><author><name>Ahvi</name><uri>http://www.blogger.com/profile/16050488529644377675</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3172594483165237090.post-2457835362978329612</id><published>2021-06-28T23:18:00.001-07:00</published><updated>2021-06-28T23:33:07.883-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Array"/><title type='text'>Bubble sort descending order</title><content type='html'>&lt;p&gt;&lt;span style=&quot;color: #800180; font-size: medium;&quot;&gt;&lt;i&gt;&lt;b&gt;Bubble sort descending order&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;#include&quot;stdio.h&quot;&lt;/p&gt;&lt;p&gt;int main()&lt;/p&gt;&lt;p&gt;{&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;int a[100],n,l,k,swap;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;printf(&quot;Enter the of Elements:&quot;);&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;scanf(&quot;%d&quot;,&amp;amp;n);&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;for(k=0;k&amp;lt;n;k++)&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;{&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;printf(&quot;Enter a[%d] :&quot;,k);&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;scanf(&quot;%d&quot;,&amp;amp;a[k]);&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;}&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;printf(&quot;Elements are :\n &quot;);&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;for(k=0;k&amp;lt;n;k++)&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;{&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;printf(&quot;%d\t&quot;,a[k]);&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;}&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;// sorting //&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;for(k=0;k&amp;lt;n;k++)&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;{&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;for(l=0;l&amp;lt;n;l++)&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;{&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;if(a[l]&amp;lt;a[l+1])&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;{&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;				&lt;/span&gt;swap = a[l+1];&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;				&lt;/span&gt;a[l+1]= a[l];&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;				&lt;/span&gt;a[l]=swap;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;}&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;}&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;}&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;printf(&quot;\nDescending order are:\n&quot;);&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;for(k=0;k&amp;lt;n;k++)&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;{&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;printf(&quot;%d \t&quot;,a[k]);&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;}&lt;/p&gt;&lt;p&gt;}&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;i&gt;&lt;span style=&quot;color: #800180; font-size: medium;&quot;&gt;Output are:&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;&lt;b&gt;Enter the of Elements:5&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;&lt;b&gt;Enter a[0] :12&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;&lt;b&gt;Enter a[1] :987&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;&lt;b&gt;Enter a[2] :456&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;&lt;b&gt;Enter a[3] :320&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;&lt;b&gt;Enter a[4] :72&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;&lt;b&gt;Elements are :&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;&lt;b&gt;&amp;nbsp;12&amp;nbsp; &amp;nbsp; &amp;nbsp;987&amp;nbsp; &amp;nbsp; &amp;nbsp;456&amp;nbsp; &amp;nbsp; &amp;nbsp;320&amp;nbsp; &amp;nbsp; &amp;nbsp;72&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;&lt;b&gt;Descending order are:&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;&lt;b&gt;987&amp;nbsp; &amp;nbsp; &amp;nbsp;456&amp;nbsp; &amp;nbsp; &amp;nbsp;320&amp;nbsp; &amp;nbsp; &amp;nbsp;72&amp;nbsp; &amp;nbsp; &amp;nbsp; 12&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='https://ahvicoding.blogspot.com/feeds/2457835362978329612/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://ahvicoding.blogspot.com/2021/06/bubble-sort-descending-order.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/3172594483165237090/posts/default/2457835362978329612'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/3172594483165237090/posts/default/2457835362978329612'/><link rel='alternate' type='text/html' href='https://ahvicoding.blogspot.com/2021/06/bubble-sort-descending-order.html' title='Bubble sort descending order'/><author><name>Ahvi</name><uri>http://www.blogger.com/profile/16050488529644377675</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3172594483165237090.post-9060139421164876088</id><published>2021-06-28T23:04:00.000-07:00</published><updated>2021-06-28T23:33:33.101-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Array"/><title type='text'>Bubble sort ascending order</title><content type='html'>&lt;p&gt;&lt;span style=&quot;color: #800180; font-size: medium;&quot;&gt;&lt;i&gt;&lt;b&gt;&amp;nbsp;Bubble sort ascending order&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;#include&quot;stdio.h&quot;&lt;/p&gt;&lt;p&gt;int main()&lt;/p&gt;&lt;p&gt;{&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;int a[100],n,l,k,swap;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;printf(&quot;Enter the of Elements:&quot;);&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;scanf(&quot;%d&quot;,&amp;amp;n);&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;for(k=0;k&amp;lt;n;k++)&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;{&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;printf(&quot;Enter a[%d] :&quot;,k);&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;scanf(&quot;%d&quot;,&amp;amp;a[k]);&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;}&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;printf(&quot;Elements are :\n &quot;);&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;for(k=0;k&amp;lt;n;k++)&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;{&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;printf(&quot;%d\t&quot;,a[k]);&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;}&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;// sorting //&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;for(k=0;k&amp;lt;n;k++)&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;{&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;for(l=0;l&amp;lt;n;l++)&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;{&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;if(a[l]&amp;gt;a[l+1])&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;{&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;				&lt;/span&gt;swap = a[l+1];&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;				&lt;/span&gt;a[l+1]= a[l];&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;				&lt;/span&gt;a[l]=swap;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;}&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;}&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;}&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;printf(&quot;\nAscending order are:\n&quot;);&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;for(k=1;k&amp;lt;n+1;k++)&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;{&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;printf(&quot;%d \t&quot;,a[k]);&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;}&lt;/p&gt;&lt;p&gt;}&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #800180; font-size: medium;&quot;&gt;&lt;i&gt;&lt;b&gt;Output are:&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;i&gt;&lt;b&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;Enter the of Elements:5&lt;/span&gt;&lt;/b&gt;&lt;/i&gt;&lt;/p&gt;&lt;p&gt;&lt;i&gt;&lt;b&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;Enter a[0] :12&lt;/span&gt;&lt;/b&gt;&lt;/i&gt;&lt;/p&gt;&lt;p&gt;&lt;i&gt;&lt;b&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;Enter a[1] :48&lt;/span&gt;&lt;/b&gt;&lt;/i&gt;&lt;/p&gt;&lt;p&gt;&lt;i&gt;&lt;b&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;Enter a[2] :75&lt;/span&gt;&lt;/b&gt;&lt;/i&gt;&lt;/p&gt;&lt;p&gt;&lt;i&gt;&lt;b&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;Enter a[3] :16&lt;/span&gt;&lt;/b&gt;&lt;/i&gt;&lt;/p&gt;&lt;p&gt;&lt;i&gt;&lt;b&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;Enter a[4] :30&lt;/span&gt;&lt;/b&gt;&lt;/i&gt;&lt;/p&gt;&lt;p&gt;&lt;i&gt;&lt;b&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;Elements are :&lt;/span&gt;&lt;/b&gt;&lt;/i&gt;&lt;/p&gt;&lt;p&gt;&lt;i&gt;&lt;b&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;&amp;nbsp;12&amp;nbsp; &amp;nbsp; &amp;nbsp;48&amp;nbsp; &amp;nbsp; &amp;nbsp; 75&amp;nbsp; &amp;nbsp; &amp;nbsp; 16&amp;nbsp; &amp;nbsp; &amp;nbsp; 30&lt;/span&gt;&lt;/b&gt;&lt;/i&gt;&lt;/p&gt;&lt;p&gt;&lt;i&gt;&lt;b&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;Ascending order are:&lt;/span&gt;&lt;/b&gt;&lt;/i&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;i&gt;&lt;b&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;12&amp;nbsp; &amp;nbsp; &amp;nbsp; 16&amp;nbsp; &amp;nbsp; &amp;nbsp; 30&amp;nbsp; &amp;nbsp; &amp;nbsp; 48&amp;nbsp; &amp;nbsp; &amp;nbsp; 75&lt;/span&gt;&lt;/b&gt;&lt;/i&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='https://ahvicoding.blogspot.com/feeds/9060139421164876088/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://ahvicoding.blogspot.com/2021/06/bubble-sort-ascending-order.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/3172594483165237090/posts/default/9060139421164876088'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/3172594483165237090/posts/default/9060139421164876088'/><link rel='alternate' type='text/html' href='https://ahvicoding.blogspot.com/2021/06/bubble-sort-ascending-order.html' title='Bubble sort ascending order'/><author><name>Ahvi</name><uri>http://www.blogger.com/profile/16050488529644377675</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>