Thursday, April 12, 2012

Pattern Program

Print this Patteren

        1
       232
      34543
     4567654
    567898765  


Soln:->

#include<stdio.h>
#include<conio.h>
 
void main()
{
      int n, c, d, num = 1, space;
      clrscr();
 
      scanf("%d",&n);
 
      space = n - 1;
 
      for ( d = 1 ; d <= n ; d++ )
      {
          num = d;
 
          for ( c = 1 ; c <= space ; c++ )
              printf(" ");
 
          space--;
 
          for ( c = 1 ; c <= d ; c++ )
          {
              printf("%d", num);
              num++;
          }
          num--;
          num--;
          for ( c = 1 ; c < d ; c++)
          {
              printf("%d", num);
              num--;
          }
          printf("\n");
 
      }
 
      getch();
}

Monday, April 09, 2012

Easyt way to Installing PHP on windows with Apache, MySql and etc...

My self Pradeep Kumar, I am here talking about PHP on windows in an Easy way...
So, Now lets start...

You need to download a XAMPP from here...
On that page you findout there are XAMPP for many types of OS...
Choose Your Operating System.
Now Click on XAMPP under Download Label:
Here You find 3 files...
1. Installer
2.Zip
3.7Zip... Donwload any file from them..

Now, If you download the Installer version of XAMPP, then open it and Installing start.....

If you download the Zip or 7Zip version of XAMPP, then extract it with the help o f any extractor to any location which you want..

that's It. You successfully Installed XAMPP a group of PHP, Appache, MySql, and other services...


You can view this on You tube. Click here for view the video.


Thnx for Reading This....

For any query Please Leave Comments!!!!!! 

Bye......

Sunday, April 01, 2012

Concatenate Two Strings without using strcat()

#include <stdio.h>
#include <conio.h>
#include <string.h>
void main()
{
char str1[30], str2[20];
int i, length=0, temp;
printf("Enter the First String: \n");
gets(str1);
printf("\nEnter the Second String: \n");
gets(str2);
for(i=0; str1[i]!='\0'; i++)
length++;
temp = length;
for(i=0; str2[i]!='\0'; i++)
{
str1[temp] = str2[i];
temp++;
}
str1[temp] = '\0';
printf("\nThe concatenated string is:\n");
puts(str1);
getch();
}

Check Whether a Character is a Vowel or not by using switch Statement

#include <stdio.h>
#include <conio.h>
void main()
{
char ch;
printf("\nEnter any character: ");
scanf("%c", &ch);
switch (ch)
{
case 'a':
case 'A':
printf("\n\n%c is a vowel", ch);
break;
case 'e':
case 'E':
printf("\n\n%c is a vowel", ch);
break;
case 'i':
case 'I':
printf("\n\n%c is a vowel", ch);
break;
case 'o':
case 'O':
printf("\n\n%c is a vowel", ch);
break;
case 'u':
case 'U':
printf("\n\n%c is a vowel", ch);
break;
default:
printf("\n\n%c is not a vowel", ch);
}
getch();
}

Add Two Matices

#include <stdio.h>
#include <conio.h>
void main()
{
int a[10][10], b[10][10], c[10][10], i, j, row, col;
printf("\nEnter number of rows and columns: ");
scanf("%d %d", &row, &col);
printf("\nEnter elements of Array A:\n");
for (i=0; i<row; i++)
for (j=0; j<col; j++)
scanf("%d", &a[i][j]);
printf("\nEnter elements of Array B:\n");
for (i=0; i<row; i++)
for (j=0; j<col; j++)
scanf("%d", &b[i][j]);
printf("\nElements of Matrix A:\n\n");
for (i=0; i<row; i++)
{
for (j=0; j<col; j++)
printf("\t%d", a[i][j]);
printf("\n\n");
}
printf("\nElements of Matrix B:\n\n");
for (i=0; i<row; i++)
{
for (j=0; j<col; j++)
printf("\t%d", b[i][j]);
printf("\n\n");
}
for (i=0; i<row; i++)
for (j=0; j<col; j++)
c[i][j] = a[i][j] + b[i][j];
printf("\nMatrix Addition is:\n\n");
for (i=0; i<row; i++)
{
for (j=0; j<col; j++)
printf("\t%d", c[i][j]);
printf("\n");
}
getch();
}