Search This Blog

Showing posts with label c. Show all posts
Showing posts with label c. Show all posts

Monday, 10 September 2012

How To Declare Keyword as Variable ?




Contact :  https://www.facebook.com/rajvishwakarma15

How To Declare Keyword as Variable ?



A Simple Example:
using System;
class A
{
    public static void Main(string[] a)
   {
         int @for=20;
         Console.WriteLine(@for);
Console.Readkey();
   }
}

Similarly This You can declare any Keyword As Variable.
Thanks.

Saturday, 7 July 2012

3x3 MATRIX MULTIPLICATION in C Language

3x3 MATRIX MULTIPLICATION

#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
main()
{
int a[3][3], b[3][3], c[3][3];
int i, j, k;
clrscr();
printf(" Enter elements of first matrix\n ");
for( i = 0; i < 3; i++ )
{
for( j = 0; j < 3; j++ )
{
printf(" \n Enter a[%d] [%d] element: ", i, j);
scanf(" %d ", &a[i] [j] );
}
}
printf(" Enter elements of second matrix\n ");
for( i = 0; i < 3; i++ )
{
for( j = 0; j < 3; j++ )
{
printf(" \n Enter b[%d] [%d] element: ", i, j );
scanf(" %d ", &b[i][j]);
}
}
printf(" \n\n First matrix is\n\n ");
for( i = 0; i < 3; i++ )
{
for( j = 0; j < 3; j++ )
printf(" %2d ", a[i][j]);
printf(" \n ");
}printf(" \n\nSecond matrix is\n ");
for( i = 0; i < 3; i++ )
{
for( j = 0; j < 3; j++ )
printf(" %2d ", b[i][j]);
printf(" \n ");
}
for( i = 0; i < 3; i++ )
{
for( j = 0; j < 3; j++ )
{
c[i][j] = 0;
for( k = 0; k < 3; k++ )
c[i][j] = c[i][j] + a[i][k] * b[k][j];
}
}
printf(" \n\n Multiplication of two matrices is\n ");
for( i = 0; i < 3; i++ )
{
for(j = 0; j < 3; j++ )
printf(" %2d ", c[i][j]);
printf(" \n ");
}
getch();
}