TRANSPOSE OF A MATRIX in C | Example of Transpose of Matrix in C | Transpose of Matrix Program in C Language | C Assignment to Transpose of two matrix

TRANSPOSE OF A MATRIX in C | Example of Transpose of Matrix in C | Transpose of Matrix Program in C Language | C Assignment to Transpose of two matrix


#include
void main()
{
int A[5][5], B[5][5], i, j, m, n;
clrscr();
printf("\n\n\t ENTER A ORDER OF THE MATRIX M,N...: ");
scanf("%d,%d",&m,&n);
printf("\n\n\t ENTER THE ELEMENTS OF THE MATRIX..:\n\n");
for(i=1;i<=m;i++)
{
for(j=1;j<=n;j++)
{
gotoxy(20+j*4,12+i*2);
scanf("%d",&A[i][j]);
}
printf("\n");
}
for(i=1;i<=m;i++)
for(j=1;j<=n;j++)
B[j][i] = A[i][j];
printf("\n\t THE TRANSPOSE OF A MATRIX IS...:\n\n\t\t ");
for(i=1;i<=n;i++)
{
for(j=1;j<=m;j++)
printf(" %d",B[i][j]);
printf("\n\n\t\t ");
}
getch();
}




Related Links :

C Program TO FIND THE SUM OF PRIMARY DIAGONAL OF A MATRIX | Matrix Program in C | Diagonal Sum of two matrix in C

C Program TO FIND THE SUM OF PRIMARY DIAGONAL OF A MATRIX | Matrix Program in C | Diagonal Sum of two matrix in C


#include
void main()
{
int A[5][5],i,j,m,n,sum = 0;
clrscr();
printf("\n\n\t ENTER A ORDER OF THE MATRIX M,N...: ");
scanf("%d,%d",&m,&n);
printf("\n\n\t ENTER THE ELEMENTS OF THE MATRIX..:\n\n");
if(m == n)
{
for(i=1;i<=m;i++)
{
for(j=1;j<=n;j++)
{
gotoxy(20+j*4,12+i*2);
scanf("%d",&A[i][j]);
}
printf("\n");
}
for(i=1;i<=m;i++)
sum = sum + A[i][i];
printf("\n\t THE SUM OF PRIMARY DIAGONAL OF A MATRIX IS...: %d", sum);
}
else
{
printf("\n\t THE ORDER OF THE MATRIX IS NOT CORRECT");
printf("\n\n\t HELP : 'M' SHOULD BE EQUAL TO 'N'");
}
getch();
}




Related Links :

C Program TO FIND THE DIFFERENCE OF TWO MATRICES | Difference of 2 matrix | matrix Program in C | matrix assignment to find difference of two matrix

C Program TO FIND THE DIFFERENCE OF TWO MATRICES | Difference of 2 matrix | matrix Program in C | matrix assignment to find difference of two matrix




#include
void main()
{
int A[5][5], B[5][5], C[5][5], i, j, m, n;
clrscr();
printf("\n\n\t ENTER A ORDER OF THE MATRICES M,N...: ");
scanf("%d,%d", &m, &n);
printf("\n\n\t ENTER THE ELEMENTS OF THE FIRST MATRIX..:\n\n");
for(i=1;i<=m;i++)
{
for(j=1;j<=n;j++)
{
gotoxy(25+j*4,12+i*2);
scanf("%d",&A[i][j]);
}
printf("\n");
}
printf("\n\t ENTER THE ELEMENTS OF THE SECOND MATRIX..:\n\n");
for(i=1;i<=m;i++)
{
for(j=1;j<=n;j++)
{
gotoxy(25+j*4,18+m+i*2);
scanf("%d",&B[i][j]);
}
printf("\n");
}
for(i=1;i<=m;i++)
for(j=1;j<=n;j++)
C[i][j] = A[i][j] - B[i][j];
printf("\n\t THE DIFFERENCE OF TWO MATRICES IS...:\n\n\t\t\t ");
for(i=1;i<=m;i++)
{
for(j=1;j<=n;j++)
printf(" %d",C[i][j]);
printf("\n\n\t\t\t ");
}
getch();
}



Related Links :

C Program TO FIND THE SUM OF SECONDARY DIAGONAL OF A MATRIX

C Program TO FIND THE SUM OF SECONDARY DIAGONAL OF A MATRIX


#include
void main()
{
int A[5][5],i,j,m,n,sum = 0;
clrscr();
printf("\n\n\t ENTER A ORDER OF THE MATRIX M,N...: ");
scanf("%d,%d",&m,&n);
printf("\n\n\t ENTER THE ELEMENTS OF THE MATRIX..:\n\n");
if(m == n)
{
for(i=1;i<=m;i++)
{
for(j=1;j<=n;j++)
{
gotoxy(20+j*4,12+i*2);
scanf("%d",&A[i][j]);
}
printf("\n");
}
for(i=1;i<=m;i++)
sum = sum + A[i][n+1-i];
printf("\n\t THE SUM OF SECONDARY DIAGONAL OF A MATRIX IS...: %d", sum);
}
else
{
printf("\n\t THE ORDER OF THE MATRIX IS NOT CORRECT");
printf("\n\n\t HELP : 'M' SHOULD BE EQUAL TO 'N'");
}
getch();
}



Related Links :

Indian flag using c graphics

Indian flag using c graphics | Indian Flag In C | C Program to create Indian flag using c graphics


#include

#include

#include

main()

{

int gd,gm,i,j=0;

clrscr();

gd=DETECT;

initgraph(&gd,&gm," ");

delay(5000);

setcolor(6);

rectangle(225,125,355,155);

while(j<=23)

{

for (i=0;i<123;i++)

outtextxy(225+i,125+j,"Û");

j++;

}

delay(5000);

setcolor(7);

rectangle(225,155,355,185);

j=0;

while(j<=23)

{

for (i=0;i<123;i++)

outtextxy(225+i,155+j,"Û");

j++;

}

delay(5000);

setcolor(2);

rectangle(225,185,355,215);

j=0;

while(j<=23)

{

for (i=0;i<123;i++)

outtextxy(225+i,185+j,"Û");

j++;

}

delay(5000);

setcolor(9);

rectangle(220,120,225,440);

j=0;

while(j<=312)

{

for (i=0;i<1;i++)

outtextxy(220+i,120+j,"Û");

j++;

}

delay(5000);

rectangle(200,440,245,450);

delay(5000);

rectangle(190,450,260,460);

delay(5000);

rectangle(175,460,275,470);

delay(5000);

circle(290,170,13);

delay(5000);

line(290,158,290,184);

delay(5000);

line(279,171,301,171);

delay(5000);

line(281,160,299,180);

delay(5000);

line(281,180,299,160);

delay(5000);

settextstyle(3,0,7);

delay(10000);

setcolor(5);

outtextxy(100,5,"I LOVE INDIA ");

delay(10000);

outtextxy(350,410,"India is Good");

getch();

}



Related Links :

evaluate Prefix Expression in C | C Program to show evaluate Prefix Expression in C | evaluate Prefix Expression in C Example

evaluate Prefix Expression in C | C Program to show evaluate Prefix Expression in C | evaluate Prefix Expression in C Example




#include
#include
#include
#include

#define MAX 30
#define OPERAND 10
#define OPERATOR 20

typedef struct prexp
{
int top;
int stack[MAX];
}stck;

void init(stck*);
void push(stck*,int);
int pop(stck*);
void eval(stck*,char,int,int);
int gettype(char);
void main()
{
char pre[MAX];
int num1,num2,item,l,i,pr;
stck stk;

fflush(stdin);
clrscr();

init(&stk);
printf(" ENTER THE PREFIX EXPRESSION ");
gets(pre);
l=strlen(pre);

for(i=l-1;i>=0;i--)
{
if(pre[i]==' ' || pre[i]=='\0')
continue;
switch(gettype(pre[i]))
{
case OPERAND : item=pre[i]-'0';
push(&stk,item);
break;
case OPERATOR : num1=pop(&stk);
num2=pop(&stk);
eval(&stk,pre[i],num1,num2);
}
}
printf("%d",stk.stack[0]);
getch();
}

void init(stck *st )
{
st->top=-1;
}

void push(stck *st,int num)
{
st->top++;
st->stack[st->top]=num;
}

int pop(stck *st)
{
int num;
num=st->stack[st->top];
st->top--;
return num;
}

void eval(stck *st,char op,int num1,int num2)
{
int res;
switch(op)
{
case '+': res=num1+num2;
break;
case '-': res=num1-num2;
break;
case '*': res=num1*num2;
break;
case '/': res=num1/num2;
break;
case '%': res=num1%num2;
break;
case '$': res=pow(num1,num2);
break;
}
push(st,res);
}

int gettype(char c)
{
switch(c)
{
case '+':
case '-':
case '*':
case '/':
case '$':
case '%': return OPERATOR;
default : return OPERAND;
}
}



Related Links :

C Program to add two polynomials using array

C Program to add two polynomials using array | Adding 2 polynomials in C | Addition of polynomials in C | Assignment to addition of polynomials in C



#include
#include
#define MAX 10
struct term
{
int coeff;
int exp;
};
struct poly
{
struct term t[10];
int totalterms;
};
void initpoly(struct poly*);
void polycreate(struct poly*,int c,int e);
struct poly addpoly(struct poly,struct poly);
void display(struct poly);
void main()
{
struct poly p1,p2,p3;
clrscr();
initpoly(&p1);
initpoly(&p2);
initpoly(&p3);
polycreate(&p1,1,7);
polycreate(&p1,2,6);
polycreate(&p1,3,5);
polycreate(&p1,4,4);
polycreate(&p1,5,2);
polycreate(&p2,1,4);
polycreate(&p2,1,3);
polycreate(&p2,1,2);
polycreate(&p2,1,1);
polycreate(&p2,2,0);
p3=addpoly(p1,p2);
printf("\n First polynomial :\n ");
display(p1);
printf("\n Second polynomial :\n ");
display(p2);
printf("\n\n Resultant Polynomial :\n");
display(p3);
getch();
}
/* Initializes elements of struct poly */
void initpoly(struct poly *p)
{
int i;
p->totalterms=0;
for(i=0;i {
p->t[i].coeff=0;
p->t[i].exp=0;
}
}

/* Add the term of polynomial to the array t */
void polycreate(struct poly *p,int c,int e)
{
p->t[p->totalterms].coeff=c;
p->t[p->totalterms].exp=e;
(p->totalterms)++;
}

/* DISPLAY the polynomial equation */
void display(struct poly p)
{
int flag=0,i;
for(i=0;i {
if(p.t[i].exp != 0)
printf("%d x^%d + ",p.t[i].coeff,p.t[i].exp);
else
{
printf("%d",p.t[i].coeff);
flag=1;
}
}
if(!flag)
printf("\b\b");
}
/* ADD two polynomials p1 and p2 */
struct poly addpoly(struct poly p1,struct poly p2)
{
int i,j,c;
struct poly p3;
initpoly(&p3);
if(p1.totalterms>p2.totalterms)
c=p1.totalterms;
else
c=p2.totalterms;
for(i=0,j=0;i<=c;p3.totalterms++)
{
if(p1.t[i].coeff==0 && p2.t[j].coeff==0)
break;
if(p1.t[i].exp>=p2.t[j].exp)
{
if(p1.t[i].exp==p2.t[j].exp)
{
p3.t[p3.totalterms].coeff=p1.t[i].coeff + p2.t[j].coeff;
p3.t[p3.totalterms].exp=p1.t[i].exp;
i++;
j++;
}
else
{
p3.t[p3.totalterms].coeff=p1.t[i].coeff;
p3.t[p3.totalterms].exp=p1.t[i].exp;
i++;
}
}
else
{
p3.t[p3.totalterms].coeff=p2.t[j].coeff;
p3.t[p3.totalterms].exp=p2.t[j].exp;
j++;
}
}
return p3;
}



Related Links :

What would be the equivalent pointer expression for referring the array element a[i][j][k][l] ?




a[i][j][k][l] can be shown as *(*(*(*(a+i)+j)+k)+l)


Related Links :

Defining a Union in C | Unions In C | Using Union in C Language

Defining a Union in C | Unions In C | Using Union in C Language



What is a Union?

If we are having the less memory to use in our program, for example 64K, we can use a single memory location for more than one variable this is called union.
You can use the unios in the followig locations.

  1. You can share a single memory location for a variable myVar1 and use the same location for myVar2 of different data type when myVar1 is not required any more.
  2. You can use it if you want to user, for example, a long variable as two short type variables.
  3. When you dont know what type of data is to be passed to a function, and you pass union which contains all the possible data types.

Defining a Union

Union can be defined by the keyword union.

union myUnion{  int var1;  long var2; };

Here we have defined a union with the name myUnion and it has two members i.e. var1 of type int and var2 of type long

Declaring the Union

We can declare the union in various ways. By taking the above example we can declare the above defined union as.

union myUnion{  int var1;  long var2; }newUnion;

So newUnion will be the variable of type myUnion. We can also declare the union as

myUnion newUnion;

Initializing the Union

We can initialize the union in various ways. For example

union myUnion{  int var1;  long var2; }newUnion={10.5};

or we can initialize it as

newUnion.var1= 10;

In later stages we can also initialize the var2 as well but this will over write the var1 value. Normally when we declare the union it is allocated the memory that its biggest member can occupy. So here in our example newUnion will occupy the memory which a long type variable can occupy.

Related Links :

Typecasting in C | Typecasting Example in C Language | Typecasting Examples in C

Typecasting in C | Typecasting Example in C Language | Typecasting Examples in C




int main()
{
/* The (char) is a typecast, telling the computer to interpret the 65 as acharacter, not as a number. It is going to give the character output of the equivalent of the number 65 (It should be the letter A for ASCII). Note that the %c below is the format code for printing a single character
*/

printf( "%c\n", (char)65 );
getchar();
}




If you were paying careful attention, you might have noticed something kind of strange: when we passed the value of x to printf as a char, we'd already told the compiler that we intended the value to be treated as a character when we wrote the format string as %c. Since the char type is just a small integer, adding this typecast actually doesn't add any value!

So when would a typecast come in handy? One use of typecasts is to force the correct type of mathematical operation to take place. It turns out that in C (and other programming languages), the result of the division of integers is itself treated as an integer: for instance, 3/5 becomes 0! Why? Well, 3/5 is less than 1, and integer division ignores the remainder.

On the other hand, it turns out that division between floating point numbers, or even between one floating point number and an integer, is sufficient to keep the result as a floating point number. So if we were performing some kind of fancy division where we didn't want truncated values, we'd have to cast one of the variables to a floating point type. For instance, (float)3/5 comes out to .6, as you would expect!

Related Links :

C Program to play wavefile | Play Audio File in C | Audio output in C Language

C Program to play wavefile | Play Audio File in C | Audio output in C Language



/****************************************************************************
** WARNING: You need a HUGE memory model to run this. **
**************************************************************************** */
//Include files
#include "ALLOC.H"
#include "DOS.H"
#include "CONIO.H"
#include "STDIO.H"
void playwav(char wavefile[14],float delaytime);
struct WaveData {
unsigned int SoundLength, Frequency;
char *Sample;
};
struct HeaderType {
long RIFF; //RIFF header
char NI1 [18]; //not important
unsigned int Channels; //channels 1 = mono; 2 = stereo
long Frequency; //sample frequency
char NI2 [6]; //not important
char BitRes; //bit resolution 8/16 bit
char NI3 [12]; //not important
} Header;
struct WaveData Voice; //Pointer to wave file
unsigned int Base; //Sound Blaster base address
char WaveFile [25]; //File name for the wave file to be played

int ResetDSP(unsigned int Test)
{
//Reset the DSP
outportb (Test + 0x6, 1);
delay(10);
outportb (Test + 0x6, 0);
delay(10);
//Check if (reset was succesfull
if ((inportb(Test + 0xE) & 0x80 == 0x80) && (inportb(Test + 0xA) == 0xAA))
{
//DSP was found
Base = Test;
return (1);
}
else
//No DSP was found
return (0);
}
/****************************************************************************
** Send a byte to the DSP (Digital Signal Processor) on the Sound Blaster **
****************************************************************************/
void WriteDSP(unsigned char Value)
{
//Wait for the DSP to be ready to accept data
while ((inportb(Base + 0xC) & 0x80) == 0x80);
//Send byte
outportb (Base + 0xC, Value);
}
/****************************************************************************
** Plays a part of the memory **
****************************************************************************/
void PlayBack (struct WaveData *Wave)
{
long LinearAddress;
unsigned int Page, OffSet;
unsigned char TimeConstant;
TimeConstant = (65536 - (256000000 / Wave->Frequency)) >> 8;
WriteDSP(0x40); //DSP-command 40h - Set sample frequency
WriteDSP(TimeConstant); //Write time constant
//Convert pointer to linear address
LinearAddress = FP_SEG (Wave->Sample);
LinearAddress = (LinearAddress << 4) + FP_OFF (Wave->Sample);
Page = LinearAddress >> 16; //Calculate page
OffSet = LinearAddress & 0xFFFF; //Calculate offset in the page
/*
Note - this procedure only works with DMA channel 1
*/
outportb (0x0A, 5); //Mask DMA channel 1
outportb (0x0C, 0); //Clear byte pointer
outportb (0x0B, 0x49); //Set mode
/*
The mode consists of the following:
0x49 = binary 01 00 10 01
| | | |
| | | +- DMA channel 01
| | +---- Read operation (the DSP reads from memory)
| +------- Single cycle mode
+---------- Block mode
*/
outportb (0x02, OffSet & 0x100); //Write the offset to the DMA controller
outportb (0x02, OffSet >> 8);
outportb (0x83, Page); //Write the page to the DMA controller
outportb (0x03, Wave->SoundLength & 0x100);
outportb (0x03, Wave->SoundLength >> 8);
outportb (0x0A, 1); //Unmask DMA channel
WriteDSP(0x14); // DSP-command 14h - Single cycle playback
WriteDSP(Wave->SoundLength & 0xFF);
WriteDSP(Wave->SoundLength >> 8);
}
/****************************************************************************
** Loads a wave file into memory. **
** This procedure expects a _very_ standard wave header. **
** It doesn't perform much error checking. **
****************************************************************************/
int LoadVoice (struct WaveData *Voice, char *FileName)
{
FILE *WAVFile;
//If it can't be opened...
WAVFile = fopen(FileName, "rb");
if (WAVFile == NULL) {
//..display error message
return (0);
}
//Return length of file for sound length minus 48 bytes for .WAV header
fseek(WAVFile, 0L, SEEK_END);
Voice->SoundLength = ftell (WAVFile) - 48;
fseek(WAVFile, 0L, SEEK_SET);
//Check RIFF header
if (Voice->SoundLength > 32000) {
if (Voice->SoundLength > 64000) {
Voice->SoundLength = 64000;
}
}
free(Voice->Sample);
Voice->Sample = (char *)malloc(Voice->SoundLength); //Assign memory
if (!Voice->Sample) {

return (0);
}
//Load the sample data
fread(&Header, 46, 1, WAVFile);
//Check RIFF header
if (Header.RIFF != 0x46464952) {
printf ("Not a wave file\n");
return (0);
}
//Check channels
if (Header.Channels != 1) {
printf ("Not a mono wave file\n");
return (0);
}
//Check bit resolution
if (Header.BitRes != 8) {
printf ("Not an 8-bit wave file\n");
return (0);
}
Voice->Frequency = Header.Frequency;
//Load the sample data
fread(Voice->Sample, Voice->SoundLength + 2, 1, WAVFile);
fclose (WAVFile); //Close the file
return (1);
}
void playwav (char wavefile[14], float delaytime = 1.0 )
{
if (ResetDSP (0x220)) {
//at 220h
printf ("");
} else {
if (ResetDSP (0x240)) {
//at 240h
printf ("");
} else {
//or none at all
printf ("");
return;
}
}
//Load wave file
if (LoadVoice (&Voice, wavefile)) {
//Start playback
PlayBack (&Voice);
delay(delaytime*1000);
//Stops DMA-transfer
WriteDSP (0xD0);
}
}


Related Links :

Setting pixel C Language


#include
#include
#include
#include

#define VIDEO_INT 0x10 /* the BIOS video interrupt. */
#define WRITE_DOT 0x0C /* BIOS func to plot a pixel. */
#define SET_MODE 0x00 /* BIOS func to set the video mode. */
#define VGA_256_COLOR_MODE 0x13 /* use to set 256-color mode. */
#define TEXT_MODE 0x03 /* use to set 80x25 text mode. */

#define SCREEN_WIDTH 320 /* width in pixels of mode 0x13 */
#define SCREEN_HEIGHT 200 /* height in pixels of mode 0x13 */
#define NUM_COLORS 256 /* number of colors in mode 0x13 */

typedef unsigned char byte;
typedef unsigned short word;


byte *VGA = (byte *)0xA0000; /* this points to video memory. */
word *my_clock = (word *)0x046C; /* this points to the 18.2hz system
clock. */

/**************************************************************************
* set_mode *
* Sets the video mode. *
**************************************************************************/

void set_mode(byte mode)
{
union REGS regs;

regs.h.ah = SET_MODE;
regs.h.al = mode;
int86(VIDEO_INT, ®s, ®s);
}

/**************************************************************************
* plot_pixel_slow *
* Plot a pixel by using BIOS function 0x0C (Write Dot). *
**************************************************************************/

void plot_pixel_slow(int x,int y,byte color)
{
union REGS regs;

regs.h.ah = WRITE_DOT;
regs.h.al = color;
regs.x.cx = x;
regs.x.dx = y;
int86(VIDEO_INT, ®s, ®s);
}

/**************************************************************************
* plot_pixel_fast *
* Plot a pixel by directly writing to video memory. *
**************************************************************************/

void plot_pixel_fast(int x,int y,byte color)
{
VGA[y*SCREEN_WIDTH+x]=color;
}

/**************************************************************************
* Main *
* Plots 50000 pixels two different ways: using the BIOS and by *
* directly writing to video memory. *
**************************************************************************/

void main()
{
int x,y,color;
float t1,t2;
word i,start;

if (__djgpp_nearptr_enable() == 0)
{
printf("Could get access to first 640K of memory.\n");
exit(-1);
}

VGA+=__djgpp_conventional_base;
my_clock = (void *)my_clock + __djgpp_conventional_base;

srand(*my_clock); /* seed the number generator. */
set_mode(VGA_256_COLOR_MODE); /* set the video mode. */

start=*my_clock; /* record the starting time. */
for(i=0;i<50000L;i++) /* randomly plot 50000 pixels. */
{
x=rand()%SCREEN_WIDTH;
y=rand()%SCREEN_HEIGHT;
color=rand()%NUM_COLORS;
plot_pixel_slow(x,y,color);
}

t1=(*my_clock-start)/18.2; /* calculate how long it took. */

set_mode(VGA_256_COLOR_MODE); /* set the video mode again in order
to clear the screen. */

start=*my_clock; /* record the starting time. */
for(i=0;i<50000L;i++) /* randomly plot 50000 pixels. */
{
x=rand()%SCREEN_WIDTH;
y=rand()%SCREEN_HEIGHT;
color=rand()%NUM_COLORS;
plot_pixel_fast(x,y,color);
}

t2=(*my_clock-start)/18.2; /* calculate how long it took. */
set_mode(TEXT_MODE); /* set the video mode back to
text mode. */

/* output the results... */
printf("Slow pixel plotting took %f seconds.\n",t1);
printf("Fast pixel plotting took %f seconds.\n",t2);
if (t2 != 0) printf("Fast pixel plotting was %f times faster.\n",t1/t2);

__djgpp_nearptr_disable();

return;
}




Related Links :

Setting the video mode in C Graphics

Setting the video mode in C Graphics


To set the video mode, call interrupt 0x10 (BIOS video functions) with 0 (zero) in the AH register and the desired mode number in the AL register. For mode 0x13, the code (Borland C) would be as follows:

union REGS regs;  regs.h.ah = 0x00;  /* function 00h = mode set */ regs.h.al = 0x13;  /* 256-color */ int86(0x10,&regs,&regs); /* do it! */ 

To return to text mode after the program finishes, simply set the mode number to 3.

union REGS regs;  regs.h.ah = 0x00; regs.h.al = 0x03; /* text mode is mode 3 */ int86(0x10,&regs,&regs); 

Plotting a pixel

An easy way to plot a pixel is by using function 0x0C under BIOS interrupt 0x10. For this function, set CX and DX to the pixel x and y location. The color displayed depends on the value in AL. See Table I for a list of common colors.

union REGS regs;  regs.h.ah = 0x0C;   /* function 0Ch = pixel plot */ regs.h.al = color; regs.x.cx = x;      /* x location, from 0..319  */ regs.x.dx = y;      /* y location, from 0..199  */ int86(0x10,&regs,&regs); 

This pixel-plotting method is easy, but it is also very slow. BIOS will do certain checks to make sure that the input is valid, and then it will test to see if the (x,y) coordinates are within the screen boundaries, and finally it will calculate the offset to video memory. A faster way to plot a pixel is to write directly to video memory.



Related Links :


If you face any Problem in viewing code such as Incomplete "For Loops" or "Incorrect greater than or smaller" than equal to signs then please collect from My Web Site CLICK HERE


More Useful Topics...

 

History Of C..

In the beginning was Charles Babbage and his Analytical Engine, a machine
he built in 1822 that could be programmed to carry out different computations.
Move forward more than 100 years, where the U.S. government in
1942 used concepts from Babbage’s engine to create the ENIAC, the first
modern computer.
Meanwhile, over at the AT&T Bell Labs, in 1972 Dennis Ritchie was working
with two languages: B (for Bell) and BCPL (Basic Combined Programming
Language). Inspired by Pascal, Mr. Ritchie developed the C programming
language.

My 1st Program...


#include
#include
void main ()
{
clrscr ();
printf ("\n\n\n\n");
printf ("\t\t\t*******Pankaj *******\n");
printf ("\t\t\t********************************\n");
printf ("\t\t\t\"Life is Good...\"\n");
printf ("\t\t\t********************************");
getch ();
}

Next Step...


#include
#include

void main ()
{
clrscr ();
printf ("\n\n\n\n\n\n\n\n");
printf ("\t\t\t --------------------------- \n\n");

printf ("\t\t\t | IGCT, Info Computers, INDIA | \n\n");
printf ("\t\t\t --------------------------- ");

getch ();

}

Hits!!!