Latest Post

Latest POSTS

ghfghfghgfh

hfjdshfdsfjhfdsjfkjs

C++ | Multiplication of Matrices using 2d Arrays


Introduction
 

This program is to multiply two matrices. The program below is given. The program is extendable. Look at the extending it section in this post. Go enjoy the program.

Program to multiply two matrices :


 #include<iostream.h>  
 #include<conio.h>  
 void main()  
 {  
 //clear the screen.  
 clrscr();  
 //declare variable type int  
 int a[3][3],b[3][3],i,j,k,s;  
 //Input the numbers of first matix  
 cout<<"First Matrix"<<endl;  
 for(i=0;i<3;i++)  
 {  
 for(j=0;j<3;j++)  
 {  
 cout<<"Enter number :";  
 cin>>a[i][j];  
 }  
 }  
 //Input the numbers of second matix  
 cout<<"Second Matrix"<<endl;  
 for(i=0;i<3;i++)  
 {  
 for(j=0;j<3;j++)  
 {  
 cout<<"Enter number :";  
 cin>>b[i][j];  
 }  
 }  
 //display the multipication of matrices  
 cout<<"Multiplication is"<<endl;  
 for(i=0;i<3;i++)  
 {  
 for(j=0;j<3;j++)  
 {  
 for(k=0;k<3;k++)  
 s=s+a[i][k]*b[k][j];  
 cout<<s<<"/t";  
 s=0;  
 }  
 cout<<endl;  
 }  
 //get character  
 getch();  
 }  

Output :

First Matrix

Enter the number
1
Enter the number
1
Enter the number
1
Enter the number
1
Enter the number
1
Enter the number
1
Enter the number
1
Enter the number
1
Enter the number
1

Second Matrix

Enter the number
1
Enter the number
1
Enter the number
1
Enter the number
1
Enter the number
1
Enter the number
1
Enter the number
1
Enter the number
1
Enter the number
1

Multiplication is
3 3 3
3 3 3
3 3 3

How does it work
  1. You enter the number.
  2. The number is saved in respective array for first matrix.
  3. The number is saved in respective array for second matrix.
  4. Then numbers are multiplied and printed to form of matrix.
Extending it

The program can be extended by using more numbers and making the matrix more bigger. Go extend it.

Explanation.
  1. Include ‘iostream.h’ and ‘conio.h’ files.
  2. Add void main.
  3. Start program by first clearing the screen.
  4. Declare the variables as int (name them as you want.)
  5. Add the cout and cin of array.
  6. Add for loop to print the multiplication of matrices.
At the end

You learn creating the C++ program of Multiplication of matrices using 2d array. So now enjoy the program.

Please comment on the post and share it.
And like it if you liked.

C++ | hello world

  

First C++ program, hello world

 

The hello world program is one of the simplest programs, but it already contains the fundamental components that every C++ program has. Don’t be overwhelmed, we will take a look at the code line by line.

Type the code in your favorite editor (always type, don’t use cut/paste. This is better for learning purposes).

Save the program with the name: hello.cpp.

Program of Hello World 

1:   #include<iostream.h>   
2:   #include<conio.h>   
3:   void main()   
4:   {   
5:   //clear the screen.   
6:   clrscr();  
7:  cout<<"hello world ";  
8:  getch();  
9:  }  

// A hello world program in C++

The first line in our program is a comment line. Every line that starts with two slash signs ( // ) are considered comments and will have no effect on the behavior or outcome of the program. (Words between /* and */ will also be considered as comments (old style comments)). Use comments in your programs to explain difficult sections, but don’t overdo it. It is also common practice to start every program with a brief description on what the program will do.

#include

Lines beginning with a pound sign (#) are used by the compilers pre-processor. In this case the directive #include tells the pre-processor to include the iostream standard file. This file iostream includes the declarations of the basic standard input/output library in C++. (See it as including extra lines of code that add functionality to your program).

using namespace std;

All the elements of the standard C++ library are declared within what is called a namespace. In this case the namespace with the name std. We put this line in to declare that we will make use of the functionality offered in the namespace std. This line of code is used very frequent in C++ programs that use the standard library. You will see that we will make use of it in most of the source code included in these tutorials.

int main()

int is what is called the return value (in this case of the type integer. Integer is a whole number). What is used for will be explained further down.
Every program must have a main() function. The main function is the point where all C++ programs start their execution. The word main is followed by a pair of round brackets. That is because it is a function declaration (Functions will be explained in more detail in a later tutorial). It is possible to enclose a list of parameters within the round brackets.

{}

The two curly brackets (one in the beginning and one at the end) are used to indicate the beginning and the end of the function main. (Also called the body of a function). Everything contained within these curly brackets is what the function does when it is called and executed. In the coming tutorials you will see that many other statements make use of curly brackets.

cout << “Hello World”;

This line is a C++ statement. A statement is a simple expression that can produce an effect. In this case the statement will print something to our screen.
cout represents the standard output stream in C++.
(There is also a standard input stream that will be explained in another tutorial). In this a sequence of characters (Hello World) will be send to the standard output stream (in most cases this will be your screen).
The words Hello World have to be between ” “, but the ” ” will not be printed on the screen. They indicate that the sentence begins and where it will end.
cout is declared in the iostream standard file within the std namespace. This is the reason why we needed to include that specific file. This is also the reason why we had to declare this specific namespace.
As you can see the statement ends with a semicolon (;). The semicolon is used to mark the end of the statement. The semicolon must be placed behind all statements in C++ programs. So, remember this. One of the common errors is to forget to include a semicolon after a statement.

Indentations

As you can see the cout and the return statement have been indented or moved to the right side. This is done to make the code more readable. In a program as Hello World, it seems a stupid thing to do. But as the programs become more complex, you will see that it makes the code more readable. (Also you will make fewer errors, like forgetting a curly bracket on the end of a function).
So, always use indentations and comments to make the code more readable. It will make your life (programming life at least) much easier if the code becomes more complex.

Please comment on the post and share it.
And like it if you liked.

C++ | Sum of Matrices using 2d Array

 

Introduction


This program is of sum of matrices using 2d arrays. The program below is given. The program is extendable by using more numbers for matrix.

Program of sum of matrices


1:  #include<iostream.h>  
2:  #include<conio.h>  
3:  void main()  
4:  {  
5:  //clear the screen.  
6:  clrscr();  
7:  //declare variable type int  
8:  int a[3][3],b[3][3],i,j;  
9:  //Input <span class="IL_AD" id="IL_AD5">the numbers</span> <span class="IL_AD" id="IL_AD8">of first</span> matix  
10:  cout<<"First Matrix"<<endl;  
11:  for(i=0;i<3;i++)  
12:  {  
13:  for(j=0;j<3;j++)  
14:  {  
15:  cout<<"Enter number :";  
16:  cin>>a[i][j];  
17:  }  
18:  }  
19:  //Input the numbers of <span class="IL_AD" id="IL_AD6">second</span> matix  
20:  cout<<"Second Matrix"<<endl;  
21:  for(i=0;i<3;i++)  
22:  {  
23:  for(j=0;j<3;j++)  
24:  {  
25:  cout<<"Enter number :";  
26:  cin>>b[i][j];  
27:  }  
28:  }  
29:  //display the sum of matrices  
30:  cout<<"Sum is"<<endl;  
31:  for(i=0;i<3;i++)  
32:  {  
33:  cout<<"\n";  
34:  for(j=0;j<3;j++)  
35:  {  
36:  cout<<a[i][j]+b[i][j]<<"t";  
37:  }  
38:  cout<<endl;  
39:  }  
40:  //get character  
41:  getch();  
42:  }  

Output :

First Matrix
Enter the number
1
Enter the number
2
Enter the number
3
Enter the number
4
Enter the number
5
Enter the number
6
Enter the number
7
Enter the number
8
Enter the number
9

Second Matrix
Enter the number
1
Enter the number
2
Enter the number
3
Enter the number
4
Enter the number
5
Enter the number
6
Enter the number
7
Enter the number
8
Enter the number
9

Sum is
2 4 6
8 10 12
14 16 18

How does it work
  1. You enter the number.
  2. The number is saved in respective array for first matrix.
  3. The number is saved in respective array for second matrix.
  4. Then numbers are added and printed to form of matrix.
Extending it

The program can be extended by using more numbers and making the matrix more bigger. You can also do the same program to subtract the matrices. Go ahead. Extend it.

Explanation.
  1. Include ‘iostream.h’ and ‘conio.h’ files.
  2. Add void main.
  3. Start program by first clearing the screen.
  4. Declare the variables as int (name them as you want.)
  5. Add the cout and cin of array.
  6. Add for loop to print the sum of matrices.
At the end

You learnt creating the C++ program of Sum of matrices using 2d array. So now enjoy the program.

Please comment on the post and share it.
And like it if you liked.

Download Full screen Turbo C++ For Windows 7 / windows 8 32bit / 64bit working tested

Turbo C is an Integrated Development Environment and compiler for the C programming language from Borland. First introduced in 1987, it was noted for its integrated development environment, small size, fast compile speed, comprehensive manuals and low price. In May 1990, Bore-land replaced Turbo C with Turbo C++. In 2006, Bore-land reintroduced the Turbo moniker.


 Here we are with a Turbo C++ For Windows 8   and fully working Turbo C++ compiler for Windows 7 and Windows 8 .It is a one click installation setup which enables you to use Turbo C++ on Windows 7 in full screen mode. The setup package which we are providing here is a simple  Turbo C++ For Windows 7 setup which is ready to run on Windows 8 32 and 64 bit.  

Important: This version is both working on Windows 7 and windows 8 in both bit [ 32 bit and 64 bit ] Full screen mode tested.

 File Size:           6.83 MB  
 License:           Freeware  
 Price:           FREE  





Go to This link for Download and enjoy programming : Click Here     [Link Updated.]

Create Separate Contact Page in Blogger



Blogger launched it’s official version of the Contact Form Widget but, it works only on the Blogger Sidebar. If you don’t want to add the contact form to your Blog’s sidebar but want it to appear on a specific page, then this tutorial will help you out. I didn’t want the contact form to appear every where on my blog. So I have moved it to a separate Contact Me Page.

How to move the Blogger Contact Form to a separate Page

 

Follow the below steps to move the Contact Form to a separate page. If you would like to see a demo, you can check out my Contact page.
  1. First, add the Blogger Contact Form Widget to your sidebar. (We will hide the contact form later in this tutorial, but you have to add it) . My previous tutorial on adding a blogger contact form widget will help you out.
  2. Now create a new page in your blog

Copy the below contact form code block
 <div class="widget ContactForm" id="ContactForm1">  
 <div class="contact-form-widget">  
 <div class="form">  
 <form name="contact-form">  
 <div>  
 Your Name : </div>  
 <input class="contact-form-name" id="ContactForm1_contact-form-name" name="name" size="30" type="text" value="" />&nbsp;   
 <div>  
 Your Email: <i>(required)</i></div>  
 <input class="contact-form-email" id="ContactForm1_contact-form-email" name="email" size="30" type="text" value="" />&nbsp;   
 <div>  
 Your Message: <i>(required)</i></div>  
 <textarea class="contact-form-email-message" id="ContactForm1_contact-form-email-message" name="email-message" rows="5"></textarea>&nbsp; <input class="contact-form-button contact-form-button-submit" id="ContactForm1_contact-form-submit" type="button" value="Send" />   
 <div style="max-width: 450px; text-align: center; width: 100%;">  
 </div>  
 </form>  
 </div>  
 </div>  
 </div>  
 </div>  
 </div>  

While creating the Page, you have to switch to the HTML mode as shown in the image below. Then paste the above code into the post editor, disable the comments and publish your page.


Now go to Template > Edit HTML

 
and Jump to the Contact Form Code and expand with widget code




and then expand the main b : includable



Now delete the code highlighted below



so that it ends up like


 And Add CSS coding

Past coding

 .contact-form-widget {  
 width: 500px;  
 max-width: 100%;  
 margin: 0 auto;  
 padding: 10px;  
 background: #F8F8F8;  
 color: #000;  
 font-family: Goudy Old Style;  
 font-size:18px;  
 border: 1px solid #C1C1C1;  
 box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);  
 border-radius: 10px;  
 }  
 /* Fields and submit button */  
 .contact-form-name {  
 background: white;  
 border: 1px solid #DDD;  
 border-radius: 5px;  
 box-shadow: 0 0 5px #DDD inset;  
 color: #666;  
 outline: none;  
 height:25px;  
 width: 300px;  
 }  
 .contact-form-name:hover{  
 background: white;  
 border: 1px solid #ffa853;  
 border-radius: 5px;  
 box-shadow: 0 0 5px 3px #ffa853;  
 color: #000;  
 outline: none;  
 }  
 .contact-form-name:focus{  
 outline: none;  
 border: 1px solid #7bc1f7;  
 box-shadow: 0px 0px 8px #7bc1f7;  
 -moz-box-shadow: 0px 0px 8px #7bc1f7;  
 -webkit-box-shadow: 0px 0px 8px #7bc1f7;  
 }  
 .contact-form-email {  
 background: white;  
 border: 1px solid #DDD;  
 border-radius: 5px;  
 box-shadow: 0 0 5px #DDD inset;  
 color: #666;  
 outline: none;  
 height:25px;  
 width: 300px;  
 }  
 .contact-form-email:hover {  
 background: white;  
 border: 1px solid #ffa853;  
 border-radius: 5px;  
 box-shadow: 0 0 5px 3px #ffa853;  
 color: #000;  
 outline: none;  
 }  
 .contact-form-email:Focus{  
 outline: none;  
 border: 1px solid #7bc1f7;  
 box-shadow: 0px 0px 8px #7bc1f7;  
 -moz-box-shadow: 0px 0px 8px #7bc1f7;  
 -webkit-box-shadow: 0px 0px 8px #7bc1f7;  
 }  
 .contact-form-email-message {  
 width: 100%;  
 max-width: 100%;  
 margin-bottom: 10px;  
 background: white;  
 border: 1px solid #DDD;  
 border-radius: 5px;  
 box-shadow: 0 0 5px #DDD inset;  
 color: #666;  
 outline: none;  
 }  
 .contact-form-email-message:hover {  
 background: white;  
 border: 1px solid #ffa853;  
 border-radius: 5px;  
 box-shadow: 0 0 5px 3px #ffa853;  
 color: #000;  
 outline: none;  
 }  
 .contact-form-email-message:focus {  
 outline: none;  
 border: 1px solid #7bc1f7;  
 box-shadow: 0px 0px 8px #7bc1f7;  
 -moz-box-shadow: 0px 0px 8px #7bc1f7;  
 -webkit-box-shadow: 0px 0px 8px #7bc1f7;  
 }  
 /* Submit button style */  
 .contact-form-button-submit {  
 border-color: #C1C1C1;  
 background: #E3E3E3;  
 color: #585858;  
 width: 20%;  
 max-width: 20%;  
 margin-bottom: 10px;  
 }  
 /* Submit button on mouseover */  
 .contact-form-button-submit:hover{  
 background: #4C8EF9;  
 color: #ffffff;  
 border: 1px solid #FAFAFA;  
 }  
  1. Now we have prevented the Contact Form Widget from appearing anywhere on the sidebar but have kept the widget registered.Make sure that you don't remove the widget from the Layout Page.
  2. Save the Template and it’s done.You now have a separate contact page on your Blogger blog.
  3.  
     Happy Blogging!

how to add data | month| year and day in blogger



Live Demo

 

How to Add add data | month| year and day in blogger

Go to Blogger >> template

Step 1  Copy the following code and paste inside an Template (script)

  
 <div id='mydate'>  
       <script type='text/javascript'>  
        /*<![CDATA[*/  
        var mydate=new Date()  
        var year=mydate.getYear()  
        if (year < 1000)  
         year+=1900  
         var day=mydate.getDay()  
         var month=mydate.getMonth()  
         var daym=mydate.getDate()  
         if (daym<10)  
          daym="0"+daym  
          var dayarray=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")  
          var montharray=new Array("January","February","March","April","May","June","July","August","September","October","November","December")  
          document.write(""+dayarray[day]+", "+montharray[month]+" "+daym+", "+year+"")  
          /*]]>*/  
       </script>  

Step 2 Copy the following code and paste inside an Template (CSS)

 #mydate {  
     color: #ffffff;  
     display: inline-block;  
     float: right;  
     font-size: 14px;  
     padding: 4px 10px;  
     font-family: 'Bree Serif', serif;  
 }  
 #mydate a {  
      background: none repeat scroll 0 0 #333333;  
      color: #ffffff;  
      font-family: sans-serif;  
      font-weight: bolder;  
      padding: 13px 16px 16px;  
 }  

Step 3 Check blog

How To Remove Showing Posts With Label Show All Posts

Getting rid of the message "showing posts with a specific label" above your blog title why you choose on a particular label will help you get your blog to look more professional and less of blog like features. When it comes to proper blog navigation, blog labels can never be overlooked as it helps your blog readers to navigate easily to different sections of your webpage. Personally i hate to see this message while navigating on my blog or others blog, so if you hate to see the message like me, don't worry as this tutorial will walk you through the steps you need to take to get rid of this message. Check out the image below to have an idea of how the said message looks like.

 How To Remove Showing Posts With Label Show All Posts

The Tutorial Proper: How To Remove Showing Posts With Label . Show All Posts
Log in to your blog dashboard => Backup your blogger template, in case you make any mistake in the process.

Go to templates and click on Edit HTML.

Click anywhere inside the template editor and press Ctrl+F and find the code below.

  <b:includable id='status-message'>  

Copy and past the code above in the search bar and press enter on your keyboard to locate it.

How To Remove Showing Posts With Label . Show All Posts

Now, after locating the code, click on the arrow in on the left side of the code as seen in the image below.
How To Remove Showing Posts With Label . Show All Posts

Now after clicking on the arrow, you will see a code like the one below.

                How To Remove Showing Posts With Label . Show All Posts

Replace all of these codes above with the one below.
 <b:includable id='status-message'>  
 <b:if cond='data:navMessage'><div>  
 </div>  
 <div style='clear: both;'/>  
 </b:if>  
 </b:includable>  

Now save your template and reload your blog to see the changes.



That was all about "How To Remove Showing Posts With Label . Show All Posts". I hope you did it successfully? please share your your thoughts and ideas with us via the comment section