Write a simple program using CIN and COUT functions in C++.
Answers
Answered by
1
Answer:
#include <bits/stdc++.h>
using namespace std;
int main (){
int n ;
cin>>n;
n*=2;
cout<<n;
}
//input 5
//output 10
Answered by
9
Question :
To write a simple program using CIN and COUT functions in C++.
Answer :
Simple Program Using CIN and COUT in C++ :
To display The largest number if the number is 18 or more.
#include <iostream>
Using namespace std;
int main ( )
{
int num ;
cout <<" Enter the number :";
cin >> num;
if ( num >= 18 )
cout << " Largest Number";
return 0 ;
}
Output :
Enter the number : 23
Largest Number
Structure Of C++ Program :
// comment line
# include <header files>
using namespace std;
int main ( )
{
........
Body of the Program ;
.........
return 0 ;
}
Similar questions