Q) Write a program that display table of two
Ans:
Code:
#include <iostream>
#include <conio.h>
using namespace std;
int main (int argc, char *argv[])
{
cout <<"2 * 1 = 2 "<<endl;
cout <<"2 * 2 = 4"<<endl;
cout <<"2 * 3 = 6"<<endl;
cout <<"2 * 4 = 8"<<endl;
cout <<"2 * 5 = 10"<<endl;
cout <<"2 * 6 = 12"<<endl;
cout <<"2 * 7 = 14"<<endl;
cout <<"2 * 8 = 16"<<endl;
cout <<"2 * 9 = 18"<<endl;
cout <<"2 * 10 = 20"<<endl;
getch();
return 0;
}
Code view in dev compiler:
Compile the program Ctrl+F9
Run program Ctrl+F10