Write a C++ program that uses a while structure and the tab escape sequence \t
C++ program that uses a while structure and the tab escape sequence
Object:
Write a C++ program that uses a while structure and the tab escape sequence \ t to print the following table of values:
Code:
#include<iostream>
#include<conio.h>
using namespace std;
void main()
{
int num=1;
cout<<” N\tN*10\tN*100\tN*1000\n\n”;
while (num<=5)
{
cout<<” “<<num<<“\t”<<num*10<<“\t”<<num*100<<“\t”<<num*1000<<endl;
num++;
}
getch();
}
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | #include<iostream> #include<conio.h> using namespace std; void main() { int num=1; cout<<" N\tN*10\tN*100\tN*1000\n\n"; while (num<=5) { cout<<" "<<num<<"\t"<<num*10<<"\t"<<num*100<<"\t"<<num*1000<<endl; num++; } getch(); } |
Output:
2 Responses
[…] Write a C++ program that uses a while structure and the tab escape sequence t […]
[…] Write a C++ program that uses a while structure and the tab escape sequence t […]