Sunday, March 31, 2013

C Program to show texts in several lines

The C Program given below is a Program to show several lines in C++ Programming. It's important to learn how to create a Line Break in C++ Programming. Suppose you want to show an address in the output. We all know the format of writing an address. We have to write several lines to represent an address. When we write it in Microsoft Office Word or in a Notepad Document then we may use Enter to create a new line. But in C++ Programming it's not possible. We have to use \n to create a new line where we want to create a line break. So you are going to learn about the \n command. Lets see the program given below...

#include<stdio.h>
void main()
{
printf("1.The First Line You Want to Show\n");
printf("2.The Second Line You Want to Show");
}

Output for the Above Codes
1.The First Line You Want to Show
2.The Second Line You Want to Show

Code Description

In the first line I have written #include<stdio.h>. stdio.h is a Header File. So I have commanded the Computer to include the Header File stdio.h by the codes #include<stdio.h>. conio.h and math.h are also two Header files. If you want to add them then you have to write #include<conio.h> to include conio.h header file and #include<math.h> to add the math.h header file. When you need to add two or more header files in a program then you have to write like...

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

In the Second Line I have written void main(). This is the main part of a C++ Program. You have to keep inside of void main() all of the command you want to use. The structure of void main() is given below.

void main()
{
Commads you want to use
}

In the fourth line I have written printf("1.The First Line You Want to Show\n");. Here printf is a command included in stdio.h header file. We have used this command to show some text in the output. The structure of printf is printf("Your Text");. That means you have to keep the text inside of the two double quotation (""). The program will show the text you will keep inside the Double Quotation. Though C++ does not support Capital Letter but you may use it here. That means you may write printf("YOUR TEXT"); if you want.

Look there is written printf("1.The First Line You Want to Show\n"); But in the screen you will see 1.The First Line You Want to Show only. \n won't be shown on the screen. \n is also a Command to create a new line in C++ Programming. For the command \n program will create a line break and the next part of the text will show in a new line. So the texts of the fifth line will show in a new line and the output will be...

1.The First Line You Want to Show
2.The Second Line You Want to Show

Program to Show Your Text on the Screen in C++ Programming

C++ Program to Show Your Text

on the Screen

This is the first program to start C++ Programming. When you will go to start C++ Programming then most of the programmer will start the first class with this simple program. In this program you will learn the way to show your text in C++ Programming. We have to use printf command to show any text in output. In this program we will use printf to show our given text only. But printf may be used to show any result of the program also. For example you may input two numbers from keyboard and you may make a calculation of them, then you also need to use printf to show the result. Lets see the program given below...

#include<stdio.h>
void main()
{
printf("Provide the Text Here You Want to Show");
}

Output for the Above Codes:
Provide the Text Here You Want to Show

Code Description

In the first line I have written #include<stdio.h>. stdio.h is a Header File. So I have commanded the Computer to include the Header File stdio.h by the codes #include<stdio.h>. conio.h and math.h are also two Header files. If you want to add them then you have to write #include<conio.h> to include conio.h header file and #include<math.h> to add the math.h header file. When you need to add two or more header files in a program then you have to write like...

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

In the Second Line I have written void main(). This is the main part of a C++ Program. You have to keep inside of void main() all of the command you want to use. The structure of void main() is given below.

void main()
{
Commands you want to use
}

In the fourth line I have written printf("Provide the Text Here You Want to Show");. Here printf is a command included in stdio.h header file. We have used this command to show some text in the output. The structure of printf is printf("Your Text");. That means you have to keep the text inside of the two double quotation (""). The program will show the text you will keep inside the Double Quotation. Though C++ does not support Capital Letter but you may use it here. That means you may write printf("YOUR TEXT"); if you want.

Sunday, March 10, 2013

Add Two Numbers Providing the Value from Keyboard


#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
int a,b,c;
printf("input the value of a=");
scanf("%d",&a);
printf("input the value of b=");
scanf("%d",&b);
c=a+b;
printf("input the summation is=%d",c);
getch();
}

A C++ Program to Add Two Numbers


#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
int a,b,c;
a=5;
b=8;
c=a+b;
printf("the result is=%d",c);
getch();
}

C++ Codes to Display Text


This Program is to display some text only.
#include<stdio.h>
#include<conio.h>
main()
    {
clrscr();
printf(" AAAAAAAAAAAAn");
printf("  AAAAAAAAAAn");
printf("   AAAAAAAAn");
printf("    AAAAAn");
printf("     AAAn");
printf("      An");
getch();
    }

#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
printf("AAAAAAAAAAAAn AAAAAAAAAAn  AAAAAAAAn   AAAAAn    AAAn     A");
getch();
}

C Program to find out salary


This is a program for c. You can find out someone's salary detail with this program.


#include<stdio.h>
void main(){
   float basic, medical, others, fund, total, year;
   printf("Please Enter The Basic: ");
   scanf("%f",&basic);
   basic=basic;
   medical=basic*.1;
   fund=basic*.15;
   others=basic*.2;
   total=basic+medical-fund+others;
   year=total*12;
   printf("Basic=%f\n",basic);
   printf("Medical=%f\n",medical);
   printf("Others=%f\n",others);
   printf("Monthly Total Sallery=%f\n",total);
   printf("Yearly Total Sallery=%f\n",year);
   printf("Profident Fund Per Month=%f\n",fund);
}

Tuesday, March 5, 2013

Top 20 Useful Keyboard Shortcuts You Everyone Should Know

...Important Keyboard Shortcuts...


Keyboard Shortcuts are so helpful to the Computer Users. You can save your time using Keyboard Shortcuts instead of using mouse in everywhere. For example if you need to open a file from your computer then you will normally click on Start>My Computer>Local Disc (D). But you may generally open My Computer just pressing Windows Key+E together. Thus you will be able to save your time.

 Keyboard Shortcut 01  Ctrl+C or Ctrl+Insert
You may copy the Highlighted Texts or select the Selected Item by pressing Ctrl+C or Ctrl+Insert keys together. It will take more time if you want to copy some text by the mouse. Because you need to take away your hand from the keyboard then you need to get the mouse. Then drag the text to highlight and right click to get a menu. Finally click on Copy from the menu and again keep back your fingers on the keyboard.

 Keyboard Shortcut 02  Ctrl+V or Shift+Insert
Press Ctrl+V or Shift+Insert keys together to paste the Text or Object from the clipboard. That means the recently copied item will be pasted.

 Keyboard Shortcut 03  Ctrl+Z and Ctrl+Y
You can press Ctrl+Z to undo a change. For example during editing text you may delete some text unfortunately. But you can get back those text just pressing Ctrl+Z. You may also undo any change for a few times just pressing Ctrl+Z. Thus you may redo any change by pressing Ctrl+Y. These two Keyboard Shortcuts is allowed in most of the Application Programs like MS Office Programs, Adobe Photoshop and so on.

 Keyboard Shortcut 04  Ctrl+F
Press Ctrl+F keys together to find out any text during browsing internet. Most of the browser support this shortcut. After pressing those two keys at a time a Search Box will open. Then type your text you want to find out from the current page. You may also find text from a Notepad Document by pressing Ctrl+F.

 Keyboard Shortcut 05  Alt+Tab or Alt+Esc
You may switch between the open programs by pressing Alt+Tab keys together. You may do the same thing by pressing Alt+Esc keys together also. But if you press Alt+Tab then the open programs will move forward.

 Keyboard Shortcut 06  Shift+Alt+Tab
Use Shift+Alt+Tab keys together to switch between the open programs and to move them backwards.

 Keyboard Shortcut 07  Ctrl+Tab
You may switch between tabs in a program by pressing Ctrl+Tab keys together. For example if you open four tabs in a browser during browsing internet. Then you just need to press Ctrl+Tab keys together to switch between the open tabs.

 Keyboard Shortcut 08  Shift+Ctrl+Tab
Press Shift+Ctrl+Tab to switch between tabs in a program moving backwards. That means if you press those three keys together and then if you are in the fourth tab of your browser, after pressing the keys you will swap to the third tab.

 Keyboard Shortcut 09  Windows+Tab
You the Windows Vista, Windows 7 and Windows 8 users press Windows+Tab keys together to switch through open programs in a full screenshot of the window.

 Keyboard Shortcut 10  Windows+R
Press Windows+R buttons together to open the RUN Command Box. If you want to open the RUN Command Box manually then it will take more time. And in Windows 7 or in Windows 8 it is more tough to find out RUN from the Start Menu. You have to follow Start>All Programs>Accessories>RUN to get the RUN Command Box.

 Keyboard Shortcut 11  Windows+M
When there is a window opened in your Desktop and if you want to minimize that window, you just need to press Windows+M keys together.

 Keyboard Shortcut 12  Windows+L
If you want to lock your current windows account you just need to press Windows+L keys together. After pressing Windows+L your current user account will be locked and you need to provide the password (if you set before) to access your user account.

 Keyboard Shortcut 13  Ctrl+Right Arrow Key or Ctrl+Left Arrow Key
When you are in a word processing application like Microsoft Word, Notepad or anything like this then press Ctrl+Right Arrow Key to shift the cursor after the right word from the present position. And if you press Ctrl+Left Arrow Key then the cursor will be shifted at the left side of the current left word.

 Keyboard Shortcut 14  Ctrl+Home and Ctrl+End
Press Ctrl+Home to shift the cursor at the beginning of the line and press Ctrl+End together to shift the cursor at the end of the line.

 Keyboard Shortcut 15  Ctrl+P
To print the current document of the page being viewed press Ctrl+P button together. For example when you are processing a word document in MS Word and if you are on the web page via Internet Browser, just press Ctrl+P to print the current page.