Академический Документы
Профессиональный Документы
Культура Документы
muhammadallee@gmail.com
Header File
C Way C++ Way
#include <iostream>
#include <stdio.h> // Note that there’s no ‘.h’ at the
//end. This is new (C++) style of
including header files.
Integer Input
C Way C++ Way
//Takes and integer value as input //Takes and integer value as input
//from the user and stores it in iVal. //from the user and stores it in iVal.
int iVal = 0; int iVal = 0;
scanf("%d", &iVal); cin >> iVal;
Integer Output
C Way C++ Way
Float Input
C Way C++ Way
//Takes a float value as input from //Takes a float value as input from
//the user and stores it in fVal. //the user and stores it in fVal.
float fVal = 0; float fVal = 0;
scanf("%f", &fVal); cin >> fVal;
Page 1 of 2
Float Output
C Way C++ Way
Character Input
C Way C++ Way
Character Output
C Way C++ Way
Page 2 of 2