#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);
}
create spiral in c programming?
C++ is the name of a programming language.
example of procedural programming are those programming language that have structure e.g basic,fortran,c++,c and pascal e.t.c
programming languages B and BCPL which was used to derive C
c++
The simplest way to create a table in C is to use a two-dimensional array.
C- Programing is basically a programing language of a computer. It helps to create software programing language which is usefull in creating softwares & data base programes. C programing language is the first & basic programing language. Other programing languages are:- C, C++ & C# (latest).
create spiral in c programming?
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.
C - programming language - was created in 1972.
Android is programmed in the C and C++ programming language.
C++ is the name of a programming language.
C is a programming language.
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 are those programming language that have structure e.g basic,fortran,c++,c and pascal e.t.c
programming languages B and BCPL which was used to derive C
Download 1000s of C C C++ Programming Language. http://www.guruengineers.com