answersLogoWhite

0


Best Answer

Well, I don't know what do you mean by table, but here you are:

int main (void)

{

puts ("A3 B3 C3");

puts ("A2 B2 C2");

puts ("A1 B1 C1");

return 0;

}

User Avatar

Wiki User

14y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

12y ago

#include <iostream>

using namespace std;

#define MIN 1

#define MAX 20

int main()

{

// Initialise some variables.

int h,x,y,z,num;

int** ppArray;

char* pLine;

char* p;

char c;

// Begin looping.

do

{

cout<<"Enter a number from "<<MIN<<"-"<<MAX<<" (0 to quit): ";

cin >> num;

while(cin.fail() num<0 num>MAX )

{

if( cin.fail() )

{

cin.clear();

cin >> c;

}

cout << "Invalid number, try again: ";

cin >> num;

}

if(num)

{

// Allocate array memory.

ppArray=new int*[num];

for(z=0;z<num;++z)

ppArray[z]=new int[num];

// Allocate line memory.

z=num*6;

pLine=new char[z+5];

memset(pLine,32,3);

p=&pLine[0];

p+=3;

memset(p,0x2d,z*sizeof(char)); p+=z;

memset(p,0x0a,sizeof(char)); ++p;

memset(p,0x00,sizeof(char));

// Create table.

for(x=0;x<num;++x)

for(y=0;y<num;++y)

ppArray[x][y]=(x+1)*(y+1);

// Print title.

cout<<"\nMULTIPLICATION TABLE\n";

cout<<"====================\n\n";

// Print column header.

cout<<" ";

for(h=0;h<num;)

cout<<++h<<" "<<(h<9?" ":"");

cout<<endl;

cout<<pLine;

// Print rows.

for(x=0;x<num;++x)

{

// Print row header.

cout<<(x<9?" ":"")<<x+1<<" ";

// Print row values.

for(y=0;y<num;++y)

{

z=ppArray[x][y];

cout<<"| "<<z<<(z<10?" ":z<100?" ":" ");

}

cout<<"|\n";

}

cout<<pLine<<endl;

// Tidy up.

for(z=0;z<num;++z)

delete[] ppArray[z];

delete[] ppArray;

delete[] pLine;

}

}while( num );

return(0);

}

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How you create a table in C programming language?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How you create table in c language?

The simplest way to create a table in C is to use a two-dimensional array.


Why you need C programming?

C- Programing is basically a programing language of a computer. It helps to create software programing language which is usefull in creating softwares &amp; data base programes. C programing language is the first &amp; basic programing language. Other programing languages are:- C, C++ &amp; C# (latest).


Create a spiral in C programming?

create spiral in c programming?


Can you create class in 'c'?

Class acts as an encapsulation of attributes and methods, that is used by an object oriented programming (OOP) language. Since C is not an OOP, its a structural programming language, one can not create classes in C. That is why OOP version of C was developed called C++, where one can work with classes.


When was C - programming language - created?

C - programming language - was created in 1972.


What programming language is Android written in?

Android is programmed in the C and C++ programming language.


Name of object oriented programming language?

C++ is the name of a programming language.


What do you mean by c language?

C is a programming language.


What are the Definitions on programming?

Programming is a term that describes the usage of a programming language. Programming languages (C++ for example) are languages that create programs, these programming languages should not be confused with scripting languages. Scripting languages are languages that are meant to be interpenetrated by programs. (Written in a programming language)


Example of procedural programming language and object oriented programming language?

example of procedural programming are those programming language that have structure e.g basic,fortran,c++,c and pascal e.t.c


Who are the ancestors of C programming language?

programming languages B and BCPL which was used to derive C


Websites to download c C programming language books?

Download 1000s of C C C++ Programming Language. http://www.guruengineers.com