<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.7.2" -->
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <atom:link href="http://cppnow.yolasite.com/program-blog/page/program-blog.rss" rel="self" type="application/rss+xml" />
        <title>program-blog</title>
        <description>program-blog</description>
        <link>http://cppnow.yolasite.com/program-blog/page/program-blog.php</link>
        <lastBuildDate>Fri, 23 Oct 2026 11:32:32 +0100</lastBuildDate>
        <generator>FeedCreator 1.7.2</generator>
        <item>
            <title>String reverse</title>
            <link>http://cppnow.yolasite.com/program-blog/page/program-blog/string-reverse</link>
            <description>&lt;div&gt;#include&amp;lt;iostream.h&gt;&lt;/div&gt;&lt;div&gt;#include&amp;lt;stdio.h&gt;&lt;/div&gt;&lt;div&gt;void main()&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;char a[50],b[50];&lt;/div&gt;&lt;div&gt;int i,j,count=0;&lt;/div&gt;&lt;div&gt;cout&amp;lt;&amp;lt;&quot;enter the sring:&quot;;&lt;/div&gt;&lt;div&gt;gets(a);&lt;/div&gt;&lt;div&gt;for(i=0;a[i]!='\0';++i)&lt;/div&gt;&lt;div&gt;count++;&lt;/div&gt;&lt;div&gt;for(j=count-1,i=0;j&gt;=0,i&amp;lt;count;j--,i++)&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;b[i]=a[j];&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;cout&amp;lt;&amp;lt;b;&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;br&gt;we first the size of the string then we one by one from the last element store the elements in another string of the same size from the starting&lt;br&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;</description>
            <pubDate>Wed, 10 Jun 2009 19:29:34 +0100</pubDate>
        </item>
        <item>
            <title>String number of words</title>
            <link>http://cppnow.yolasite.com/program-blog/page/program-blog/string-number-of-words</link>
            <description>&lt;div&gt;#include&amp;lt;iostream.h&gt;&lt;/div&gt;&lt;div&gt;#include&amp;lt;stdio.h&gt;&lt;/div&gt;&lt;div&gt;void main()&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;char a[50];&lt;/div&gt;&lt;div&gt;int i,count=0;&lt;/div&gt;&lt;div&gt;cout&amp;lt;&amp;lt;&quot;enter the string:&quot;;&lt;/div&gt;&lt;div&gt;gets(a);&lt;/div&gt;&lt;div&gt;for(i=0;a[i]!='\0';++i)&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;if(a[i]!=' ')&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;if(a[i]!='\0')&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;count++;&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;cout&amp;lt;&amp;lt;&quot;\nthe number of words in the string  =&quot;&amp;lt;&amp;lt;count;&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;br&gt;we simply check werther a given word is space or null character if no then we increment the value of count if yes then the loop stops or next increment takes palce.</description>
            <pubDate>Wed, 10 Jun 2009 19:18:01 +0100</pubDate>
        </item>
        <item>
            <title>String size</title>
            <link>http://cppnow.yolasite.com/program-blog/page/program-blog/string-size</link>
            <description>&lt;div&gt;#include&amp;lt;iostream.h&gt;&lt;/div&gt;&lt;div&gt;#include&amp;lt;stdio.h&gt;&lt;/div&gt;&lt;div&gt;void main()&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;char a[50];&lt;/div&gt;&lt;div&gt;int i;&lt;/div&gt;&lt;div&gt;cout&amp;lt;&amp;lt;&quot;enter the string:&quot;;&lt;/div&gt;&lt;div&gt;gets(a);&lt;/div&gt;&lt;div&gt;for(i=0;a[i]!='\0';++i)&lt;/div&gt;&lt;div&gt;;&lt;/div&gt;&lt;div&gt;cout&amp;lt;&amp;lt;&quot;\nthe size of string is =&quot;&amp;lt;&amp;lt;i;&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;br&gt;int his program we simply start to check from the starting which number eleement is the nullcharacter which signifies the end of the string and the number so obtained add one to it and that is the size of the string one is added because in array first element has address 0 whreas while counting we take first element as 1</description>
            <pubDate>Wed, 10 Jun 2009 19:08:07 +0100</pubDate>
        </item>
        <item>
            <title>Matrix transpose</title>
            <link>http://cppnow.yolasite.com/program-blog/page/program-blog/matrix-transpose</link>
            <description>&lt;div&gt;#include&amp;lt;iostream.h&gt;&lt;/div&gt;&lt;div&gt;#include&amp;lt;process.h&gt;&lt;/div&gt;&lt;div&gt;#include&amp;lt;conio.h&gt;&lt;/div&gt;&lt;div&gt;void main()&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;int a[10][10],b[10][10],rowa,cola,i,j;&lt;/div&gt;&lt;div&gt;cout&amp;lt;&amp;lt;&quot;enter the number of rows=&quot;;&lt;/div&gt;&lt;div&gt;cin&gt;&gt;rowa;&lt;/div&gt;&lt;div&gt;cout&amp;lt;&amp;lt;&quot;enter the number of coloumn=&quot;;&lt;/div&gt;&lt;div&gt;cin&gt;&gt;cola;&lt;/div&gt;&lt;div&gt;cout&amp;lt;&amp;lt;&quot;enter the elements of matrix A\n&quot;;&lt;/div&gt;&lt;div&gt;for(i=0;i&amp;lt;rowa;i++)&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;for(j=0;j&amp;lt;cola;j++)&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;cout&amp;lt;&amp;lt;&quot;a[&quot;&amp;lt;&amp;lt;i&amp;lt;&amp;lt;&quot;][&quot;&amp;lt;&amp;lt;j&amp;lt;&amp;lt;&quot;]&quot;&amp;lt;&amp;lt;&quot;=&quot;;&lt;/div&gt;&lt;div&gt;cin&gt;&gt;a[i][j];&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;for(i=0;i&amp;lt;rowa;i++)&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;for(j=0;j&amp;lt;cola;j++)&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;b[i][j]=a[j][i];          //transposing&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;for(i=0;i&amp;lt;rowa;i++)&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;cout&amp;lt;&amp;lt;endl;&lt;/div&gt;&lt;div&gt;for(j=0;j&amp;lt;cola;j++)&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;cout&amp;lt;&amp;lt;b[i][j]&amp;lt;&amp;lt;&quot; &quot;;&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;br&gt;for transposing a matrix we simply interchange the value of the row and coloumn of the matrix and store the elements in serial order into another matrix.</description>
            <pubDate>Wed, 10 Jun 2009 18:58:22 +0100</pubDate>
        </item>
        <item>
            <title>Matrix multiplication</title>
            <link>http://cppnow.yolasite.com/program-blog/page/program-blog/matrix-multiplication</link>
            <description>&lt;div&gt;#include&amp;lt;iostream.h&gt;&lt;/div&gt;&lt;div&gt;#include&amp;lt;process.h&gt;&lt;/div&gt;&lt;div&gt;#include&amp;lt;conio.h&gt;&lt;/div&gt;&lt;div&gt;void main()&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;int a[10][10],b[10][10],c[10][10],rowa,cola,rowb,colb,i,j,k;&lt;/div&gt;&lt;div&gt;cout&amp;lt;&amp;lt;&quot;enter the data for matrix A\n&quot;;&lt;/div&gt;&lt;div&gt;cout&amp;lt;&amp;lt;&quot;enter the number of rows=&quot;;&lt;/div&gt;&lt;div&gt;cin&gt;&gt;rowa;&lt;/div&gt;&lt;div&gt;cout&amp;lt;&amp;lt;&quot;enter the number of coloumns=&quot;;&lt;/div&gt;&lt;div&gt;cin&gt;&gt;cola;&lt;/div&gt;&lt;div&gt;cout&amp;lt;&amp;lt;&quot;enter the data for matrix B\n&quot;;&lt;/div&gt;&lt;div&gt;cout&amp;lt;&amp;lt;&quot;enter the number of rows=&quot;;&lt;/div&gt;&lt;div&gt;cin&gt;&gt;rowb;&lt;/div&gt;&lt;div&gt;cout&amp;lt;&amp;lt;&quot;enter the number of coloumns=&quot;;&lt;/div&gt;&lt;div&gt;cin&gt;&gt;colb;&lt;/div&gt;&lt;div&gt;if(cola!=rowb)                       //checking compatibility&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;cout&amp;lt;&amp;lt;&quot;Matrix cannot be multipied\n&quot;;&lt;/div&gt;&lt;div&gt;exit(0);&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;cout&amp;lt;&amp;lt;&quot;Matrix have same order and can be multiplied\npress enter \n&quot;;&lt;/div&gt;&lt;div&gt;getch();&lt;/div&gt;&lt;div&gt;clrscr();&lt;/div&gt;&lt;div&gt;cout&amp;lt;&amp;lt;&quot;enter the elements of matrix A\n&quot;;&lt;/div&gt;&lt;div&gt;for(i=0;i&amp;lt;rowa;i++)&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;for(j=0;j&amp;lt;cola;j++)&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;cout&amp;lt;&amp;lt;&quot;a[&quot;&amp;lt;&amp;lt;i&amp;lt;&amp;lt;&quot;][&quot;&amp;lt;&amp;lt;j&amp;lt;&amp;lt;&quot;]&quot;&amp;lt;&amp;lt;&quot;=&quot;;&lt;/div&gt;&lt;div&gt;cin&gt;&gt;a[i][j];                                   //reading Matrix A&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;cout&amp;lt;&amp;lt;&quot;enter the elements of matrix B\n&quot;;&lt;/div&gt;&lt;div&gt;for(i=0;i&amp;lt;rowb;i++)&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;for(j=0;j&amp;lt;colb;j++)&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;cout&amp;lt;&amp;lt;&quot;a[&quot;&amp;lt;&amp;lt;i&amp;lt;&amp;lt;&quot;][&quot;&amp;lt;&amp;lt;j&amp;lt;&amp;lt;&quot;]&quot;&amp;lt;&amp;lt;&quot;=&quot;;&lt;/div&gt;&lt;div&gt;cin&gt;&gt;b[i][j];                                   //reading Matrix B&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;for(i=0;i&amp;lt;rowb;i++)&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;for(j=0;j&amp;lt;colb;j++)&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;c[i][j]=0;&lt;/div&gt;&lt;div&gt;for(k=0;k&amp;lt;cola;k++)&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;c[i][j]=c[i][j]+a[i][k]*b[k][j];              //multiplication of matrix&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;for(i=0;i&amp;lt;rowa;i++)&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;cout&amp;lt;&amp;lt;endl;&lt;/div&gt;&lt;div&gt;for(j=0;j&amp;lt;colb;j++)&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;cout&amp;lt;&amp;lt;c[i][j]&amp;lt;&amp;lt;&quot; &quot;;               //printing result&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;br&gt;in this program first we check for compatibility of matrix weather the the number of coloumn of first matrix is equal to the number of rows of the second matrix.for adding we use the rule that for multiplication we multiply the row elements of first matrix to the coloumn elements of the second matrix.this is done by using two variable i and j for row and coloumn respectivily and then using a third variable k for adding the product of the row element and the coloumn element .k changes the coloumn number in the first matrix and also changes the row number in the second matrix.we store the rsult in matrix c .here we should note that the result is ste by step stored because of the repaeted add statemant execution were i have marked as multiplication of matrix using comment .</description>
            <pubDate>Wed, 10 Jun 2009 18:53:50 +0100</pubDate>
        </item>
        <item>
            <title>Matrix subtraction</title>
            <link>http://cppnow.yolasite.com/program-blog/page/program-blog/matrix-subtraction</link>
            <description>&lt;div&gt;#include&amp;lt;iostream.h&gt;&lt;/div&gt;&lt;div&gt;#include&amp;lt;process.h&gt;&lt;/div&gt;&lt;div&gt;#include&amp;lt;conio.h&gt;&lt;/div&gt;&lt;div&gt;void main()&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;int a[10][10],b[10][10],c[10][10],rowa,cola,rowb,colb,i,j;&lt;/div&gt;&lt;div&gt;cout&amp;lt;&amp;lt;&quot;enter the data for matrix A\n&quot;;&lt;/div&gt;&lt;div&gt;cout&amp;lt;&amp;lt;&quot;enter the number of rows=&quot;;&lt;/div&gt;&lt;div&gt;cin&gt;&gt;rowa;&lt;/div&gt;&lt;div&gt;cout&amp;lt;&amp;lt;&quot;enter the number of coloumns=&quot;;&lt;/div&gt;&lt;div&gt;cin&gt;&gt;cola;&lt;/div&gt;&lt;div&gt;cout&amp;lt;&amp;lt;&quot;enter the data for matrix B\n&quot;;&lt;/div&gt;&lt;div&gt;cout&amp;lt;&amp;lt;&quot;enter the number of rows=&quot;;&lt;/div&gt;&lt;div&gt;cin&gt;&gt;rowb;&lt;/div&gt;&lt;div&gt;cout&amp;lt;&amp;lt;&quot;enter the number of coloumns=&quot;;&lt;/div&gt;&lt;div&gt;cin&gt;&gt;colb;&lt;/div&gt;&lt;div&gt;if((rowa!=rowb)&amp;amp;&amp;amp;(cola!=colb))&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;cout&amp;lt;&amp;lt;&quot;Matrix cannot be added\n&quot;;&lt;/div&gt;&lt;div&gt;exit(0);&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;cout&amp;lt;&amp;lt;&quot;Matrix have same order and can be subtracted\npress enter \n&quot;;&lt;/div&gt;&lt;div&gt;getch();&lt;/div&gt;&lt;div&gt;clrscr();&lt;/div&gt;&lt;div&gt;cout&amp;lt;&amp;lt;&quot;enter the elements of matrix A\n&quot;;&lt;/div&gt;&lt;div&gt;for(i=0;i&amp;lt;rowa;i++)&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;for(j=0;j&amp;lt;cola;j++)&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;cout&amp;lt;&amp;lt;&quot;a[&quot;&amp;lt;&amp;lt;i&amp;lt;&amp;lt;&quot;][&quot;&amp;lt;&amp;lt;j&amp;lt;&amp;lt;&quot;]&quot;&amp;lt;&amp;lt;&quot;=&quot;;&lt;/div&gt;&lt;div&gt;cin&gt;&gt;a[i][j];&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;cout&amp;lt;&amp;lt;&quot;enter the elements of matrix B\n&quot;;&lt;/div&gt;&lt;div&gt;for(i=0;i&amp;lt;rowb;i++)&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;for(j=0;j&amp;lt;colb;j++)&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;cout&amp;lt;&amp;lt;&quot;a[&quot;&amp;lt;&amp;lt;i&amp;lt;&amp;lt;&quot;][&quot;&amp;lt;&amp;lt;j&amp;lt;&amp;lt;&quot;]&quot;&amp;lt;&amp;lt;&quot;=&quot;;&lt;/div&gt;&lt;div&gt;cin&gt;&gt;b[i][j];&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;for(i=0;i&amp;lt;rowb;i++)&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;for(j=0;j&amp;lt;colb;j++)&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;c[i][j]=a[i][j]-b[i][j];&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;for(i=0;i&amp;lt;rowa;i++)&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;cout&amp;lt;&amp;lt;endl;&lt;/div&gt;&lt;div&gt;for(j=0;j&amp;lt;cola;j++)&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;cout&amp;lt;&amp;lt;c[i][j]&amp;lt;&amp;lt;&quot; &quot;;&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;br&gt;In this program firstly we read the matrix using nested for loop in one for loop we increment the value of i for row value from 0 to 1 and in the other for loop we increment the value of j for coloumn value from 0 to 1.after reading the values of the two matrixs we subtract each variable of the two variable which have the same row and coloumn and store the result in the matrix C  at the corresponding address.as that of the matrix variables.</description>
            <pubDate>Wed, 10 Jun 2009 18:06:23 +0100</pubDate>
        </item>
        <item>
            <title>Matrix addition</title>
            <link>http://cppnow.yolasite.com/program-blog/page/program-blog/matrix-addition</link>
            <description>&lt;div&gt;#include&amp;lt;iostream.h&gt;&lt;/div&gt;&lt;div&gt;#include&amp;lt;process.h&gt;&lt;/div&gt;&lt;div&gt;#include&amp;lt;conio.h&gt;&lt;/div&gt;&lt;div&gt;void main()&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;int a[10][10],b[10][10],c[10][10],rowa,cola,rowb,colb,i,j;&lt;/div&gt;&lt;div&gt;cout&amp;lt;&amp;lt;&quot;enter the data for matrix A\n&quot;;&lt;/div&gt;&lt;div&gt;cout&amp;lt;&amp;lt;&quot;enter the number of rows=&quot;;&lt;/div&gt;&lt;div&gt;cin&gt;&gt;rowa;&lt;/div&gt;&lt;div&gt;cout&amp;lt;&amp;lt;&quot;enter the number of coloumns=&quot;;&lt;/div&gt;&lt;div&gt;cin&gt;&gt;cola;&lt;/div&gt;&lt;div&gt;cout&amp;lt;&amp;lt;&quot;enter the data for matrix B\n&quot;;&lt;/div&gt;&lt;div&gt;cout&amp;lt;&amp;lt;&quot;enter the number of rows=&quot;;&lt;/div&gt;&lt;div&gt;cin&gt;&gt;rowb;&lt;/div&gt;&lt;div&gt;cout&amp;lt;&amp;lt;&quot;enter the number of coloumns=&quot;;&lt;/div&gt;&lt;div&gt;cin&gt;&gt;colb;&lt;/div&gt;&lt;div&gt;if((rowa!=rowb)&amp;amp;&amp;amp;(cola!=colb))&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;cout&amp;lt;&amp;lt;&quot;Matrix cannot be added\n&quot;;&lt;/div&gt;&lt;div&gt;exit(0);&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;cout&amp;lt;&amp;lt;&quot;Matrix have same order and can be added\n&quot;;&lt;/div&gt;&lt;div&gt;getch();&lt;/div&gt;&lt;div&gt;clrscr();&lt;/div&gt;&lt;div&gt;cout&amp;lt;&amp;lt;&quot;enter the elements of matrix A\n&quot;;&lt;/div&gt;&lt;div&gt;for(i=0;i&amp;lt;rowa;i++)&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;for(j=0;j&amp;lt;cola;j++)&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;cout&amp;lt;&amp;lt;&quot;a[&quot;&amp;lt;&amp;lt;i&amp;lt;&amp;lt;&quot;][&quot;&amp;lt;&amp;lt;j&amp;lt;&amp;lt;&quot;]&quot;&amp;lt;&amp;lt;&quot;=&quot;;&lt;/div&gt;&lt;div&gt;cin&gt;&gt;a[i][j];&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;cout&amp;lt;&amp;lt;&quot;enter the elements of matrix B\n&quot;;&lt;/div&gt;&lt;div&gt;for(i=0;i&amp;lt;rowb;i++)&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;for(j=0;j&amp;lt;colb;j++)&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;cout&amp;lt;&amp;lt;&quot;a[&quot;&amp;lt;&amp;lt;i&amp;lt;&amp;lt;&quot;][&quot;&amp;lt;&amp;lt;j&amp;lt;&amp;lt;&quot;]&quot;&amp;lt;&amp;lt;&quot;=&quot;;&lt;/div&gt;&lt;div&gt;cin&gt;&gt;b[i][j];&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;for(i=0;i&amp;lt;rowb;i++)&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;for(j=0;j&amp;lt;colb;j++)&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;c[i][j]=a[i][j]+b[i][j];&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;for(i=0;i&amp;lt;rowa;i++)&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;cout&amp;lt;&amp;lt;endl;&lt;/div&gt;&lt;div&gt;for(j=0;j&amp;lt;cola;j++)&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;cout&amp;lt;&amp;lt;c[i][j]&amp;lt;&amp;lt;&quot; &quot;;&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;br&gt;&lt;span class=&quot;yui-non&quot;&gt; In this program firstly we read the matrix using nested for loop in one for loop we increment the value of i for row value from 0 to 1 and in the other for loop we increment the value of j for coloumn value from 0 to 1.after reading the values of the two matrixs we add each variable of the two variable which have the same row and coloumn and store the result in the matrix C  at the corresponding address.as that of the matrix variables.&lt;/span&gt;</description>
            <pubDate>Wed, 10 Jun 2009 18:15:57 +0100</pubDate>
        </item>
        <item>
            <title>calculator-switch case</title>
            <link>http://cppnow.yolasite.com/program-blog/page/program-blog/calculator-switch-case</link>
            <description>&lt;div&gt;//calculator&lt;/div&gt;&lt;div&gt;//switch case&lt;/div&gt;&lt;div&gt;#include&amp;lt;iostream.h&gt;&lt;/div&gt;&lt;div&gt;void main()&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;float a,b,c;&lt;/div&gt;&lt;div&gt;int choice;&lt;/div&gt;&lt;div&gt;cout&amp;lt;&amp;lt;&quot;enter the first number=&quot;;&lt;/div&gt;&lt;div&gt;cin&gt;&gt;a;&lt;/div&gt;&lt;div&gt;cout&amp;lt;&amp;lt;&quot;enter the second number=&quot;;&lt;/div&gt;&lt;div&gt;cin&gt;&gt;b;&lt;/div&gt;&lt;div&gt;cout&amp;lt;&amp;lt;&quot;enter the operation\n1=addition\n2=substraction\n3=multiplication\n4=division\n&quot;;&lt;/div&gt;&lt;div&gt;cin&gt;&gt;choice;&lt;/div&gt;&lt;div&gt;switch(choice)&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;case 1:&lt;/div&gt;&lt;div&gt;c=a+b;&lt;/div&gt;&lt;div&gt;cout&amp;lt;&amp;lt;&quot;addition=&quot;&amp;lt;&amp;lt;c;&lt;/div&gt;&lt;div&gt;break;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;case 2:&lt;/div&gt;&lt;div&gt;c=a-b;&lt;/div&gt;&lt;div&gt;cout&amp;lt;&amp;lt;&quot;substraction=&quot;&amp;lt;&amp;lt;c;&lt;/div&gt;&lt;div&gt;break;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;case 3:&lt;/div&gt;&lt;div&gt;c=a*b;&lt;/div&gt;&lt;div&gt;cout&amp;lt;&amp;lt;&quot;product=&quot;&amp;lt;&amp;lt;c;&lt;/div&gt;&lt;div&gt;break;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;case 4:&lt;/div&gt;&lt;div&gt;c=a/b;&lt;/div&gt;&lt;div&gt;cout&amp;lt;&amp;lt;&quot;quotient=&quot;&amp;lt;&amp;lt;c;&lt;/div&gt;&lt;div&gt;break;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;default:&lt;/div&gt;&lt;div&gt;cout&amp;lt;&amp;lt;&quot;wrong choice&quot;;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;&lt;br&gt;explaination:In this program the switch case is being used were the user choses the case before the switch statement is executed.after choosing the case in numbers the chosen case is executed and the result is printed in the last statements but if the choice is not defined then wrong choice message is printed&lt;/div&gt;if this expaination was useful then kindly leave a comment if not still leave a coment&lt;br&gt;&lt;span class=&quot;yui-non&quot;&gt; &lt;/span&gt;</description>
            <pubDate>Tue, 09 Jun 2009 18:56:04 +0100</pubDate>
        </item>
        <item>
            <title>fibonacci series-for loop</title>
            <link>http://cppnow.yolasite.com/program-blog/page/program-blog/fibonacci-series-for-loop</link>
            <description>&lt;div&gt;&lt;div&gt;//Fibonacci series&lt;/div&gt;&lt;div&gt;//program to implement fibonacci series of a number&lt;/div&gt;&lt;div&gt;#include&amp;lt;iostream.h&gt;&lt;/div&gt;&lt;div&gt;void main()&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;int n,first=0,second=1,third;&lt;/div&gt;&lt;div&gt;cout&amp;lt;&amp;lt;&quot;enter the number of elements=&quot;;&lt;/div&gt;&lt;div&gt;cin&gt;&gt;n;&lt;/div&gt;&lt;div&gt;cout&amp;lt;&amp;lt;&quot;\n&quot;&amp;lt;&amp;lt;first&amp;lt;&amp;lt;&quot;  &quot;;&lt;/div&gt;&lt;div&gt;cout&amp;lt;&amp;lt;second&amp;lt;&amp;lt;&quot;  &quot;;&lt;/div&gt;&lt;div&gt;for(int i=0;i&amp;lt;n;i++)&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;third=first+second;&lt;/div&gt;&lt;div&gt;cout&amp;lt;&amp;lt;third&amp;lt;&amp;lt;&quot;  &quot;;&lt;/div&gt;&lt;div&gt;first=second;&lt;/div&gt;&lt;div&gt;second=third;&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;br&gt;&lt;span class=&quot;yui-non&quot;&gt;fibonacci series is a series in which every third number is the sum of the two preceding numbers.In this program e use three numbers first,second,third.first we print the values of the first and second numbers.then we use for loop for repeatedly executing the statements i.e.we first add first and second number and store the result in third.Then we print the third variable. after this we store the value of second in first and the value of third in second and these steps are repeatedly executed .the number of terms to be displayed n is put in the conditional statement of the for loop.&lt;/span&gt;&lt;/div&gt;</description>
            <pubDate>Wed, 10 Jun 2009 04:47:38 +0100</pubDate>
        </item>
        <item>
            <title>Factorial-for loop</title>
            <link>http://cppnow.yolasite.com/program-blog/page/program-blog/factorial-for-loop</link>
            <description>&lt;div&gt;//FACTORIAL&lt;/div&gt;&lt;div&gt;//program to implement factorial of a number&lt;/div&gt;&lt;div&gt;#include&amp;lt;iostream.h&gt;&lt;/div&gt;&lt;div&gt;void main()&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;int number,fact=1;&lt;/div&gt;&lt;div&gt;cout&amp;lt;&amp;lt;&quot;enter the number=&quot;;&lt;/div&gt;&lt;div&gt;cin&gt;&gt;number;&lt;/div&gt;&lt;div&gt;for(int i=1;i&amp;lt;=number;i++)&lt;/div&gt;&lt;div&gt;fact=fact*i;&lt;/div&gt;&lt;div&gt;cout&amp;lt;&amp;lt;&quot;\nfactorial=&quot;&amp;lt;&amp;lt;fact;&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;br&gt;The logic of the program is that we are first giving a value 1 to the factorial and then repeatedly multiplying all the numbers from 1 to the input number, to the factorial of the number by using a for loop.this is done by incrementing the value of i from 1 to the input number and then puting the following statement fact=fact*i; &lt;br&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;</description>
            <pubDate>Wed, 10 Jun 2009 04:37:38 +0100</pubDate>
        </item>
    </channel>
</rss>
