Write a programme to display a message this is my first programme.??
#include<iostream.h>
#include<conio.h>
Void main()
{
Clrscr();
Cout<<" This is my first programme ";
getch();
}
#include<conio.h>
Void main()
{
Clrscr();
Cout<<" This is my first programme ";
getch();
}
Note:-
When we write programmes in Windows. This is some useful functions (dos operating system)
👉1. <Iostream.h> :-
This is the header file we Used in c++ programming .
It
means to stream the input and output operation that is performed in the
programming. The term stream in intended to suggest that the characters are
generated or consumed, sequentially over time.
In simple word the working
procedure or function of cout, cin and other related input and output
function is defined in this library if we want to use this is our programme
we have to import or include this is our code or program.
.
2.👉<Conio.h> :-
This is a header file declares Several useful library functions for
performing " Console input and output "from a program. It is available
for Windows only.
3. 👉Void main() :-
After including the header file our next work is starting main we write the interas programme within main. The programme which is the within out side of the main does not work.
Only variable declaration and creation function etc. Are the few work which can we done outside of the main later we will learn. There must be one main in a programme and it should not be more than one.
4. 👉Clrscr() ; :-
This is used to clear the screen That is standard output device
5.👉 Cout<<" "; :-
It is responsible for display in programme we can display any message,
value of any variable, anything through it.
Example:-
output:-
a. Cout<<" I like c++";
I like c++
b. Cout<<"2+4";
2+4
6. 👉getch() ; :-
Read any character directly ( within any buffer) from
standard input device. But it doesn't echo readed character (can't see on
screen).
In simple words the working it is used to stop the output screen.
In simple words the working it is used to stop the output screen.
When we write programmes in Windows. This the some useful
function.
1. Int :-
int, sort for " Integer ", is fundamental variable type built into
the compiler and used to define numeric variables holding whole numbers.....
C, C++, C# and many other programming languages recognize int as a data
type.
2. Float :-
The float is a data type of computer, that is composed of a number
that is not an integer, because it includes a fraction represented in decimal
format..
3. Cin :-
This is used to accept value from user in variable
Syntax:-
cin>>variable name
cin>>n1>>n2>>n3;
Example:- int
m;
cin>>m;
int p, c, m;
cin>>p>>c>>m;
our website: https://codemasternisha.blogspot.com/
1. Write a programme to accept a number from user and check it.
#include<iostream.h>
#include<conio.h>
Void main ()
{
Clrscr () ;
Int nm;
Cout<<"please give a number ";
Cin>>nm;
Getch();
}
2.Write a programme to accept two numbers from user and display it.
#include<iostream.h>
#include<conio.h>
Void main ()
{
Clrscr() ;
Int num1, num2;
Cout<<" Enter two numbers ";
Cin>>num1>>num2;
Getch();
}
3.Write a programme to accept five decimal numbers and display it.
#include<iostream.h>
#include<conio.h>
Void main ()
{
Clrscr() ;
Float n1, n2, n3, n4, n5;
Cout<<" Enter five numbers ";
Cin>>n1>>n2>>n3>>n4>>n5;
Cout<<n1<<n2<<n3<<n4<<n5;
Getch();
}
Our website:
😇 https://codemasternisha.blogspot.com/😇
Importants concept about C++ Programming...
👉 IF you want to know How to solve Complex type of mathematical Problem in C++
Programming CLICK HERE
if you face any any problem or any issue about our website then fill the
contact us page and write your issues in it ...
👇👇👇👇👇👇👇👇👇👇👇👇👇
KEEP SUPPORTING 👌 !! KEEP LEARNING 📚 !!
😇😇😇😇😇😇😇
3 Comments
wow
ReplyDeletevery very helpfull
ReplyDeleteif else
ReplyDeletein javascript Learn Free by CodeExampler