Showing posts with label a. Show all posts
Showing posts with label a. Show all posts

Tuesday, 8 April 2014

How to hide a folder without Any software-cmd Tricks-No one can't find the folder

How to hide a folder without Any software-cmd Tricks-No one can't find the folder

Step 1:-

           Open RUN --> Type 'cmd' in RUN -->Enter.

Step 2:-

           Go to the drive of the folder.(ex:  d: (d:\>) )

Step 3:-

           To Hide a folder attrib -s -h demo

(i) attrib-Attribute.

(ii) s-System.

(iii) h-Hide

(iv) 'demo'- Folder Name.

Tats it. .. ..


To view hidden folder.

Similary type in cmd prompt as 'attrib +s +h demo'

Monday, 31 March 2014

C Programming graphics | To restrict mouse pointer in a circle using C graphics

C Programming graphics | To restrict mouse pointer in a circle using C graphics

Source code:-)

#include<graphics.h>
#include<conio.h>
#include<dos.h>
#include<stdlib.h>
#include<math.h>

union REGS i, o;

int initmouse()
{
   i.x.ax = 0;
   int86(0X33, &i, &o);
   return ( o.x.ax );
}

void showmouseptr()
{
   i.x.ax = 1;
   int86(0X33, &i, &o);
}

void hidemopuseptr()
{
   i.x.ax = 2;
   int86(0X33,&i,&o);
}

void getmousepos(int *x, int *y)
{
   i.x.ax = 3;
   int86(0X33, &i, &o);
   *x = o.x.cx;
   *y = o.x.dx;

}

void movemouseptr(int x, int y)
{
   i.x.ax = 4;
   i.x.cx = x;
   i.x.dx = y;
   int86(0X33, &i, &o);
}

main()
{
   int gd = DETECT, gm, midx, midy, radius, x, y, tempx, tempy;

   radius = 100;

   initgraph(&gd, &gm, "C:\\TC\\BGI");

   if(!initmouse())
   {
      closegraph();
      exit(1);
   }

   midx = getmaxx()/2;
   midy = getmaxy()/2;

   showmouseptr();
   movemouseptr(midx, midy);
   circle(midx, midy, radius);

   x = tempx = midx;
   y = tempy = midy;

   while(!kbhit())
   {
      getmousepos(&x, &y);

      if((pow(x-midx,2)+pow(y-midy,2)-pow(radius,2))>0)
      {
         movemouseptr(tempx, tempy);
         x = tempx;
         y = tempy;
      }

      tempx = x;
      tempy = y;
   }

   closegraph();
   return 0;
}

C Programming graphics | Web browser project in c, c program to open a website/url using C graphics

C Programming graphics | Web browser project in c, c program to open a website/url using C graphics

Source code:-)

#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
#include <graphics.h>
#include <dos.h>
#include <string.h>

void initialize_graphics_mode();
int get_key();
void draw();

union REGS i, o;

main()
{
  int key, i = 0, xpos, ypos, button;
  char arr[200], temp[5], *ptr;
  char a[] = "C:\\Progra~1\\Mozill~1\\firefox ";

  strcpy(arr,a);

  i = strlen(a);

  initialize_graphics_mode();

  draw();

  while(1)
  {
    if(kbhit())
      key = get_key();

    if((key>=97&&key<=122)||(key>=65&&key<=90)||key==46||key==47||key==63)
    {
      arr[i] = key;
      sprintf(temp,"%c",arr[i]);
      outtext(temp);
      if(getx()>470)
      {
        clearviewport();
        moveto(5,2);
      }
      i++;
    }
    else if ( key == 13 )
    {
      arr[i] = '\0';
      system(arr);
      break;
    }
    else if ( key == 27 )
    {
      closegraph();
      exit(EXIT_SUCCESS);
    }
    if(button==1&&xpos>=150&&xpos<=480&&ypos>=300&&ypos<=330)
    {
      system("C:\\Progra~1\\Mozill~1\\firefox errors000.blogspot.in");
      break;
    }
    key = -1;
  }

  closegraph();
  return 0;
}

void initialize_graphics_mode()
{
  int gd = DETECT, gm, errorcode;

  initgraph(&gd,&gm,"C:\\TC\\BGI");
  errorcode = graphresult();

  if( errorcode != grOk )
  {
    printf("Graphics error : %s\n",grapherrormsg(errorcode));

    printf("Press any key to exit...\n");
    getch();
    exit(EXIT_FAILURE);
  }
}

int get_key()
{
  i.h.ah = 0;
  int86(22,&i,&o);

  return( o.h.al );
}

void draw()
{
  settextstyle(SANS_SERIF_FONT,HORIZ_DIR,2);
  outtextxy(275,11,"Web Browser");
  outtextxy(155,451,"<a href="http://errors000.blogspot.in"">errors000.blogspot.in"</a>);
  outtextxy(5,105,"Enter URL : ");
  rectangle(120,100,600,130);
  setviewport(121,101,599,129,1);
  moveto(5,1);
}

C Programming graphics | To draw a 3d bar chart using C graphics

C Programming graphics | To draw a 3d bar chart using C graphics

 Source code:-)

#include <graphics.h>
#include <conio.h>

int main()
{
   int gd = DETECT, gm;

   initgraph(&gd, &gm, "C:\\TC\\BGI");

   setcolor(YELLOW);
   rectangle(0,30,639,450);
   settextstyle(SANS_SERIF_FONT,HORIZ_DIR,2);
   setcolor(WHITE);
   outtextxy(275,0,"Bar Chart");

   setlinestyle(SOLID_LINE,0,2);

   line(100,420,100,60);
   line(100,420,600,420);
   line(90,70,100,60);
   line(110,70,100,60);
   line(590,410,600,420);
   line(590,430,600,420);

   outtextxy(95,35,"Y");
   outtextxy(610,405,"X");
   outtextxy(85,415,"O");

   setfillstyle(LINE_FILL,BLUE);
   bar(150,100,200,419);

   setfillstyle(XHATCH_FILL,RED);
   bar(225,150,275,419);

   setfillstyle(WIDE_DOT_FILL,GREEN);
   bar(300,200,350,419);

   setfillstyle(INTERLEAVE_FILL,MAGENTA);
   bar(375,125,425,419);

   setfillstyle(HATCH_FILL,BROWN);
   bar(450,175,500,419);

   getch();
   return 0;
}

C program | To Make a Simple Calculator to Add, Subtract, Multiply or Divide Using switch.....case

C program | To Make a Simple Calculator to Add, Subtract, Multiply or Divide Using switch.....case

Source code :-)

/* C programming-Source code to create a simple calculator for addition, subtraction, multiplication and division using switch...case statement */

# include <stdio.h>
int main()
{
    char o;
    float num1,num2;
    printf("Enter operator either + or - or * or divide : ");
    scanf("%c",&o);
    printf("Enter two operands: ");
    scanf("%f%f",&num1,&num2);
    switch(o) {
        case '+':
            printf("%.1f + %.1f = %.1f",num1, num2, num1+num2);
            break;
        case '-':
            printf("%.1f - %.1f = %.1f",num1, num2, num1-num2);
            break;
        case '*':
            printf("%.1f * %.1f = %.1f",num1, num2, num1*num2);
            break;
        case '/':
            printf("%.1f / %.1f = %.1f",num1, num2, num1/num2);
            break;
        default:
            /* If operator is other than +, -, * or /, error message is shown */
            printf("Error! operator is not correct");
            break;
    }
    return 0;


Output:-)

Enter operator either + or - or * or divide : -
Enter two operands: 3.4
8.4
3.4 - 8.4 = -5.0

C Program | To Find ASCII Value of a Character-Source code

C Program | To Find ASCII Value of a Character

Source code:-)

 /* Source code to find ASCII value of a character entered by user */

#include <stdio.h>
int main(){
    char c;
    printf("Enter a character: ");
    scanf("%c",&c);        /* Takes a character from user */
    printf("ASCII value of %c = %d",c,c);
    return 0;
}

Output:-)

Enter a character: G
ASCII value of G = 71

C Programming Language-C Program to Print a Statement

 C Program to Print a Statement

Source Code:-

/* C Program to print a statement. */
#include <stdio.h>
int main()
{
   printf("Welcome to Errors"); /* printf() used to prints the content inside quotation */
   return 0;
}


Output :-)

Welcome to Errors