Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

c++ multiple inputs

#include <iostream>
using namespace std;

int main() {
 	int n1, n2;
  	float f1;
  	char c1;
    
    cout<<"Enter two integers, a float and a char: ";
    cin>>n1>>n2>>f1>>c1;	//multiple input in single line
    
    cout<<"Check: "<<n1<<n2<<f1<<c1<<endl;
	return 0;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #multiple #inputs
ADD COMMENT
Topic
Name
6+6 =