Thursday 31 January 2019

Write a program to add two numbers in C++

                                     SIMPLE PROGRAM TO ADD TWO NUMBERS


1. Write this code in any c++ software.


#include<iostream.h>
#include<conio.h>
int main()
{int x,y,sum=0;
cout<<"\nEnter value of x=";
cin>>x;
cout<<"\nEnter value of y=";
cin>>y;
sum=x+y;

cout<<"\nsum is equal to ="<<sum;
getch();
return 0;
}


2. Save the file with any name and use extension .cpp for saving file.

3. First compile your program and then run.

4.OutPut



Sunday 20 January 2019

Write a program to print a message in C++

  Write a simple Program to Print a Hello Message in C++.


1. First start Turbo c++ or anyother c++ software.


2. Then type the code given below.

#include<iostream.h>
#include<conio.h>
int main()
{
clrscr();
cout<<"Hello World This is My First C++ Program";
getch();
return 0;
}



OUTPUT


DBMS NOTES UNIT 3

                                                              UNIT 3  ER (Entity Relationship) An entity-relationship model is known as an E...