Archive: June 2014

Programme for Binary search

Programme for Binary search
#include<stdio.h>
#include<conio.h>
int arr[20];
int x;
void input()
{
int i;
printf("How many elements out of 20:\n");
scanf("%d",&x);
for(i=0;i<x;i++)
 {
    printf("Enter no.=");
    scanf("%d",&arr[i]);
 }
}
void search()
{
    int n,i,mid,low,high,flag=0;
    printf("Enter no which you want to search: \n");

Programme to transpose a matrix

Programme to transpose a matrix
/* Programme to print transpose of matrix */

#include<stdio.h>
#include<conio.h>
void matrix(int x[3][3]);
void main()
{
    int x[3][3],i,j;
    clrscr();
    printf("Enter elements of matrix:\n");
    for(i=0;i<3;i++)
   {
    for(j=0;j<3;j++)
    {
    scanf("%d",&x[i][j]);
    }
   }
   printf("Entered matrix is:\n");

Programme to check Sparse matrix

Programme to check Sparse matrix
/* wap to print sparse matrix */

#include<stdio.h>
#include<conio.h>
#define n 3
void main()
{
int i,j,a[n][n],count=0;
clrscr();
printf("Enter elements of matrix\n");
for(i=0;i<n;i++)
    {
    for(j=0;j<n;j++)
    {
        scanf("%d",&a[i][j]);
    }
}
printf("You Entered matrix:\n");

How To Transfer Data Between Two Computers

In this post I will tell you how to transfer data b/w two computers through LAN cable.
Procedure:-
Firstly Check you have made straight cross cable properly.
Note: Both PC's have password on admin account

Tutorial:-
1. Connect LAN cable in both computers
2. Go to My computer properties and select remote settings
3. Check on allow remote connection and click on Ok
remote settings

4. Go to control panel->windows firewall.
5. In left side click on "Turn firewall on or off" in left side and select Turn Off firewall in both options.
firewall settings

6. Now go to Network connection in Control panel.
7. Select your Ethernet -> right click on it and go to properties.
8. Select TCP/IPv4 and click on properties.
Select "Use the following ip"
9. Give ip adress:
192.168.1.1
And subnet mask to:
255.255.255.0
And click ok and close...

IP address settings
PLEASE NOTE : DO THE ABOVE STEPS IN BOTH THE PC'S
Give second pc IP address to :
192.168.1.2
And same subnet mask..

10. Now to check connection open "cmd" in Run.
11. Type Command:
Ping 192.168.1.2(Second PC IP address)
If you get reply code it means your connection is working
And if you are getting "Request time out" error means connection is not made properly.

TO SHARE FILES AND FOLDERS:
1. Select drive/file/folder and right click on it->properties->sharing->advance sharing->share this folder
Now go to permission below this and click on allow for full control.
2. Click apply->ok->ok->close..
TO ACCESS IN ANOTHER PC:
1. Oper run and type:
\\192.168.1.2\drive name            (192.168.1.2 is second pc IP address whose file are shared)
And enter username and password of that computer...
                                                                  -------*---------

If you don't know how to make straight cross cable then please comment here and I'll tell you.
Hope you'll get knowledge on this topic. If you have any query/question feel free to ask... :)
THANKYOU...

How To Make a HUT in C language

In this tutorial I had made a programme by which you can make a HUT in C language with the help of graphics. I had also added a image to get directions for you so you can make it...
Enjoy.. :)

/* Programme to make a HUT in C language with graphics */

#include<graphics.h>
#include<conio.h>
void main()
{
int gm,gd=DETECT;
initgraph(&gd,&gm,"C:\\TurboC3\\BGI");
line(20,50,150,50);
line(20,50,5,100);
line(20,50,40,100);
rectangle(5,100,40,180);
rectangle(40,100,180,180);
line(150,50,180,100);
rectangle(85,120,125,160);
line(105,120,105,160);
line(85,140,125,140);
rectangle(10,120,35,180);
line(10,120,17,130);
line(10,180,17,170);
line(35,120,25,130);
line(35,180,25,170);
line(17,130,17,170);
line(25,130,25,170);
circle(20,85,5);
line(10,180,60,340);
line(35,180,180,340);
circle(35,200,5);
circle(55,250,15);
circle(90,310,25);
line(140,200,140,220);
line(160,200,160,220);
line(140,210,160,210);
rectangle(170,200,190,220);