Lecture
#include <iostream.h>
#include <conio.h>int main (int argc, char * argv [])
{
float a = 2.14, b = 3.54;if (a> b)
cout << a << "-Max"
<< b << "-Min \ n";
else
cout << b << "-Max"
<< a << "-Min \ n";
getch ();
return 0;
}
#include <iostream.h>
#include <conio.h>int main (int argc, char * argv [])
{
int year = 1967, month = 8;if (month <3)
cout << "His age:" << (2008 - year - 1) << '\ n';
else
cout << "His age:" << (2008 - year) << '\ n';
getch ();
return 0;
}
#include <iostream.h>
#include <conio.h>int main (int argc, char * argv [])
{
int a = 144, edinici, decjatki, sotni;
sotni = a / 100;
decjatki = (a% 100) / 10;
edinici = a% 10;if (sotni == decjatki)
cout << "There are identical numbers!";
if (sotni == edinici)
cout << "There are identical numbers!";
if (decjatki == edinici)
cout << "There are identical numbers!";getch ();
return 0;
}
#include <iostream.h>
#include <conio.h>int main (int argc, char * argv [])
{
int a = 15, b = 12, c = 35;if (a> b && a> c)
cout << "a is the largest number";
if (b> c && b> a)
cout << "b is the largest number";
if (c> a && c> b)
cout << "c is the largest number";getch ();
return 0;
}
Comments
To leave a comment
C ++ (C plus plus)
Terms: C ++ (C plus plus)