Computer Science, asked by ibrahimali4491, 5 months ago

Write a simple program using CIN and COUT functions in C++.

Answers

Answered by RvP10
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 Berseria
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