Search This Blog

Tuesday, November 20, 2012

How to install Oracle




Step-0   Double click on oracle.exe (setup)
                It will open following windows






Step-1   Hear you can specify   where to oracle install 
- Global database name specify   Global database name
- Database password specify password for login
                Then click to Next
It will open following window



Step-2 It will check product specific
                If any Error occurs then check manually by marking yes in check box  
                Then click to Next
It will open following window





Step-3   Hear just enter Registration information (CSI, country code)
                Then click to Next
It will open following window



Step-4 this window provide summary about oracle installation
                Must check for Global settings (sources, home address and installation type)
And requirement (for space, Language) must be satisfy
If anything goes then go Back and change setting
Otherwise click next.



Step-5   installation process is begin. It must be completed.
                After installation. Click to Next
It will open following window






Step-6   these 
window provide information about oracle (Database name, Location etc.).
                Password management provide password for all table and users
                At last click  OK  to complete installation.

Thursday, October 13, 2011

Write a function to find squre and cube of a num

   1:  #include<stdio.h>
   2:  #include<conio.h>
   3:  void squrecube(float x,float *s,float *c)
   4:  {
   5:  *s=x*x;
   6:  *c=x*x*x;
   7:  }
   8:  void main()
   9:  {
  10:  float x,s,c;
  11:  printf("enter the num:");
  12:  scanf("%f",&x);
  13:  squrecube(x,&s,&c);
  14:  printf("squre=%f cube=%f",s,c);
  15:  getch();
  16:  }

Write a Program to Give output

1
1 2
1 2 3


   1:  #include<stdio.h>
   2:  #include<conio.h>
   3:  void main()
   4:  {
   5:  int i,j,n,s;
   6:  printf("Enter the num of rows:\n");
   7:  scanf("%d",&n);
   8:  for(i=1;i<=n;i++)
   9:      {
  10:      for(s=n-i;s>=1;s--)
  11:          {
  12:          printf(" ");
  13:          }
  14:      for(j=1;j<=i;j++)
  15:          {
  16:          printf("%d ",j);
  17:          }
  18:      printf("\n");
  19:      }
  20:  getch();
  21:  }

Write a program that will provide a character string from command line which translates it into a number and evaluate and display its cube root

   1:  #include<stdio.h>
   2:  #include<conio.h>
   3:  #include<math.h>
   4:  #include<stdlib.h>
   5:  void main(int argc,char *argv[])
   6:  {
   7:  float x;
   8:  if(argc<2)
   9:      {
  10:      printf("Insufficient number of arguments supplied:\n");
  11:      getch();
  12:      exit(0);
  13:      }
  14:  x=atof(argv[1]);
  15:  printf("cube root of %f is %f\n",x,pow(x,1.0/3.0));
  16:  getch();
  17:  }

Write a program to read two strings and display them sorted alphabetically

   1:  #include<stdio.h>
   2:  #include<conio.h>
   3:  #include<string.h>
   4:  void main()
   5:  {
   6:  char str1[40];
   7:  char str2[40];
   8:  int n;
   9:  printf("Enter the first string:\n");
  10:  gets(str1);
  11:  printf("Enter the second string:\n");
  12:  gets(str2);
  13:  n=strcmp(str1,str2);
  14:      if(n==0)
  15:      {
  16:      printf("the strings are identical\n");
  17:      }
  18:      else
  19:      {
  20:      printf("if sorted alphabetically the strings will come in following order\n");
  21:      }
  22:      if(n<0)
  23:      {
  24:      puts(str1);
  25:      puts(str2);
  26:      }
  27:      if(n>0)
  28:      {
  29:      puts(str2);
  30:      puts(str1);
  31:      }
  32:  getch();
  33:  }

Write a program to read two strings and append second to first

   1:  #include<stdio.h>
   2:  #include<conio.h>
   3:  #include<string.h>
   4:  void main()
   5:  {
   6:  char str1[40];
   7:  char str2[40];
   8:  printf("Enter the first string:\n");
   9:  gets(str1);
  10:  printf("Enter the second string:\n");
  11:  gets(str2);
  12:  strcat(str1,str2);
  13:  printf("String 1 is now:\n");
  14:  puts(str1);
  15:  getch();
  16:  }

Write a program that will read names of three students from the keyboard store them as array of strings

   1:  #include<stdio.h>
   2:  #include<conio.h>
   3:  #include<string.h>
   4:  void main()
   5:  {
   6:  int i;
   7:  char sname[3][40];
   8:  char yourname[40];
   9:  for(i=0;i<3;i++)
  10:      {
  11:      printf("Enter the name of the student:\n");
  12:      gets(yourname);
  13:      strcpy(sname[i],yourname);
  14:      }
  15:  for(i=0;i<3;i++)
  16:  puts(sname[i]);
  17:  getch();
  18:  }

Write a program to read my number x and to evaluate x*x-2. use a function to evaluate x*x-2 and call this function through its pointer

#include<stdio.h>
#include<conio.h>
#include<math.h>
float expr(float);
void main()
{
float x,value;
printf("Enter the value of x ");
scanf("%f",&x);
value=(*expr)(x);
printf("value =%f\n",value);
getch();
}
float expr(float x)
{
return(x*x-2);
}

The trace of a square is given by the sum of the diagonal elements. Write a program to evaluate the trace of a matrix. Read the elements of matrix from keyboard and pass on its address to a function to evaluate and return the traces

   1:   #include<stdio.h>
   2:   #include<conio.h>
   3:   float trace(int n,float **x);
   4:   void main()
   5:   {
   6:   int i,j;
   7:   float *xx[10];
   8:   float t,x[10][10],num;
   9:   int n;
  10:   printf("Enter the size of matrix:\n");
  11:   scanf("%d",&n);
  12:   printf("Enter the elements:\n");
  13:   for(i=0;i<n;i++)
  14:   {
  15:      for(j=0;j<n;j++)
  16:      {
  17:      scanf("%f",&num);
  18:      x[i][j]=num;
  19:      }
  20:   }
  21:   for(i=0;i<n;i++)
  22:   xx[i]=x[i];
  23:   t=trace(n,xx);
  24:   printf("trace of matrix is: %f",t);
  25:   getch();
  26:   }
  27:   
  28:   float trace(int n,float **x)
  29:   {
  30:   int i;
  31:   float t=0.0;
  32:   for(i=0;i<n;i++)
  33:   t=t+*(*(x+i)+i);
  34:   return(t);
  35:   }

Illustrate working of increment operator(++)

   1:  #include<stdio.h>
   2:  #include<conio.h>
   3:  void main()
   4:  {
   5:  int a,b,x,y;
   6:  a=b=2;
   7:  x=a++;
   8:  y=++b;
   9:  printf("At this point \n");
  10:  printf("Value of x= %d\n",x);
  11:  printf("Value of y= %d\n",y);
  12:  getch();
  13:  }

Write a program to read elements of matrix and display them through pointers

   1:  #include<stdio.h>
   2:  #include<conio.h>
   3:  void main()
   4:  {
   5:  float x[10][10];
   6:  int i,j,nr,nc;
   7:  printf("Enter the num of rows:\n");
   8:  scanf("%d",&nr);
   9:  printf("Enter the num of columns:\n");
  10:  scanf("%d",&nc);
  11:  printf("Enter the elements of matrix:\n");
  12:  for(i=0;i<nr;i++)
  13:  {
  14:      for(j=0;j<nc;j++)
  15:      {
  16:          scanf("%f",&x[i][j]);
  17:      }
  18:  printf("\n");
  19:  }
  20:  printf("The matrix is:\n\n");
  21:  for(i=0;i<nr;i++)
  22:  {
  23:      for(j=0;j<nc;j++)
  24:      {
  25:          printf("%.2f ",*(*(x+i)+j));
  26:      }
  27:  printf("\n");
  28:  }
  29:  getch();
  30:  }

Write a program to sort an array of real Num using separate functions. Access array through pointers

   1:  #include<stdio.h>
   2:  #include<conio.h>
   3:  void readdata(int *size,float *addx)
   4:  {
   5:  int i;
   6:  float n;
   7:  char ch;
   8:  printf("Enter the elements of array:\n");
   9:  i=0;
  10:  do
  11:  {
  12:  scanf("%f%c",&n,&ch);
  13:  *(addx+i)=n;
  14:  i++;
  15:  }while(ch!='\n');
  16:  *size=i;
  17:  }
  18:   
  19:  void displayarray(int size,float *addx)
  20:  {
  21:  int i;
  22:  for(i=0;i<size;i++)
  23:  printf("%.2f ",*(addx+i));
  24:  printf("\n");
  25:  }
  26:   
  27:  void sort(int size,float *addx)
  28:  {
  29:  int i,j;
  30:  for(j=0;j<size-1;j++)
  31:  for(i=0;i<size-1;i++)
  32:  if(*(addx+i)>*(addx+i+1))
  33:      {
  34:      int p,q;
  35:      p=*(addx+i);
  36:      q=*(addx+i+1);
  37:      *(addx+i)=q;
  38:      *(addx+i+1)=p;
  39:      }
  40:  }
  41:   
  42:  void main()
  43:  {
  44:  int i,size;
  45:  float x[50];
  46:  readdata(&size,x);
  47:  printf("Array is:\n");
  48:  displayarray(size,x);
  49:  sort(size,x);
  50:  printf("sorted array is:\n");
  51:  displayarray(size,x);
  52:  getch();
  53:  }

Write a program to find the maximum element of an array of real num. Read the element of the array in function readdata() and find maximum in another function. Access the array elements through pointers.

   1:  #include<conio.h>
   2:  #include<stdio.h>
   3:  void readdata(int *size,float *addx)
   4:  {
   5:  int i;
   6:  float n;
   7:  char ch;
   8:  printf("\nEnter the elements of the array:\n");
   9:  i=0;
  10:  do
  11:  {
  12:  scanf("%f%c",&n,&ch);
  13:  *(addx+i)=n;
  14:  i++;
  15:  }while(ch!='\n');
  16:  *size=i;
  17:  }
  18:  float maxno(int size,float *addx)
  19:  {
  20:  int i;
  21:  float max=-1.0E38;
  22:  for(i=0;i<size;i++)
  23:      {
  24:      if((*addx+i)>max)
  25:      {
  26:      max=*(addx+i);
  27:      }
  28:      }
  29:  return(max);
  30:  }
  31:  void main()
  32:  {
  33:  int size;
  34:  float max;
  35:  int i;
  36:  float x[50];
  37:  readdata(&size,x);
  38:  max=maxno(size,x);
  39:  printf("\nThe array is: ");
  40:  for(i=0;i<size;i++)
  41:      printf("%.2f ",x[i]);
  42:  printf("\nThe maximum No is: %f",max);
  43:  getch();
  44:  }

write a program to read a set of real nums in one line of the keyboard and using the function maxno(), display the largest num entered.

   1:  #include<stdio.h>
   2:  #include<conio.h>
   3:  float maxno(int size,float *addx);
   4:  void main()
   5:  {
   6:  int i,size;
   7:  float x[50],max;
   8:  char ch;
   9:  printf("\nEnter the elements of array:\n");
  10:  i=0;
  11:  do
  12:  {
  13:  scanf("%f%c",&x[i],&ch);
  14:  i++;
  15:  }while(ch!='\n');
  16:  size=i;
  17:  max=maxno(size,x);
  18:  printf("\nThe maximum No is: %.2f",max);
  19:  getch();
  20:  }
  21:  float maxno(int size,float *addx)
  22:  {
  23:  int i;
  24:  float max=-1.0E38;
  25:  for(i=0;i<size;i++)
  26:  if(*(addx+i)>max)
  27:  max=*(addx+i);
  28:  return(max);
  29:  }

Write a program to read the elements of an array in a function named readdata() and display its elements in function main()

   1:  #include<stdio.h>
   2:  #include<conio.h>
   3:  void readdata(int *size,float *x);
   4:  void main()
   5:  {
   6:  int size;
   7:  int i;
   8:  float x[50];
   9:  readdata(&size,x);     //for X[i] instead of &x[0] one can take x as address of array
  10:  printf("\nThe array is ");
  11:  for(i=0;i<size;i++)
  12:  printf("%.2f ",x[i]);
  13:  getch();
  14:  }
  15:  void readdata(int *size,float *x)
  16:  {
  17:  int i;
  18:  float n;
  19:  char ch;
  20:  printf("\nEnter the elements of array:\n");
  21:  i=0;
  22:  do
  23:  {
  24:  scanf("%f%c",&n,&ch);
  25:  *(x+i)=n;
  26:  i++;
  27:  }while(ch!='\n');
  28:  *size=i;
  29:  }

Write a program to book space in the memory for array and display the address of each element

   1:  #include<stdio.h>
   2:  #include<conio.h>
   3:  void main()
   4:  {
   5:  float x[]={1.0,2.0,3.0,4.0,5.0,6.0};
   6:  int i;
   7:  float *add;
   8:  for(i=0;i<6;i++)
   9:  {
  10:  add=&x[i];
  11:  printf("Address of x[%d] is: %ld\n",i,add);
  12:  }
  13:  getch();
  14:  }

Write a function to evaluate all the three angels of triangle ABC and PQR in degrees given its sides.

   1:  #include<stdio.h>
   2:  #include<conio.h>
   3:  #include<stdlib.h>
   4:  #include<math.h>
   5:  #define PIE 3.14
   6:   
   7:  void angles(float x,float y,float z, float *a1,float *a2,float *a3);
   8:  void main()
   9:  {
  10:  float a,b,c,A,B,C;
  11:  float p,q,r,P,Q,R;
  12:  printf("Enter the sides of ABC:\n");
  13:  scanf("%f%f%f",&a,&b,&c);
  14:  printf("Enter the sides of PQR:\n");
  15:  scanf("%f%f%f",&p,&q,&r);
  16:  angles(a,b,c,&A,&B,&C);
  17:  angles(p,q,r,&P,&Q,&R);
  18:  printf("Angle A= %.2f\n",A);
  19:  printf("Angle B= %.2f\n",B);
  20:  printf("Angle C= %.2f\n",C);
  21:  printf("Angle P= %.2f\n",P);
  22:  printf("Angle Q= %.2f\n",Q);
  23:  printf("Angle R= %.2f\n",R);
  24:  getch();
  25:  }
  26:  void angles(float x,float y,float z, float *a1,float *a2,float *a3)
  27:  {
  28:  *a1=(180.0/PIE)*acos((y*y+z*z-x*x)/(2.0*y*z));
  29:  *a2=(180.0/PIE)*acos((x*x+z*z-y*y)/(2.0*z*x));
  30:  *a3=(180.0/PIE)*acos((y*y+x*x-z*z)/(2.0*y*x));
  31:  }

Write a program to, as arguments, the co-efficient of a,b,c of the quadratic equation ax2+bx+c=0 and evaluates its roots such that both the roots will be available in the calling function.

   1:  #include<stdio.h>
   2:  #include<conio.h>
   3:  #include<math.h>
   4:  #include<stdlib.h>
   5:  void roots(float a,float b,float c,float *r1,float *r2);
   6:  void main()
   7:  {
   8:  float a,b,c,root1,root2;
   9:  printf("Enter the coefficient of a,b,c:\n");
  10:  scanf("%f%f%f",&a,&b,&c);
  11:  roots(a,b,c,&root1,&root2);
  12:  printf("Roots of the equation are %.2f and %.2f\n",root1,root2);
  13:  getch();
  14:  }
  15:  void roots(float a,float b,float c,float *r1,float *r2)
  16:  {
  17:  float d;
  18:  d=b*b-4.0*a*c;
  19:  if(d<0)
  20:  {
  21:  printf("no real root\n");
  22:  getch();
  23:  exit(0);
  24:  }
  25:  else
  26:  *r1=(-b+sqrt(d))/(2.0*a);
  27:  *r2=(-b-sqrt(d))/(2.0*a);
  28:  }

Write a program to generate a random int num and assign the same to a variable x through pointer. Display the value of x

   1:  #include<stdio.h>
   2:  #include<conio.h>
   3:  #include<stdlib.h>
   4:  void main()
   5:  {
   6:  int x,i;
   7:  int *xptr=&x;
   8:  srand(12345);
   9:  *xptr=rand();
  10:  printf("x=%d\n",x);
  11:  getch();
  12:  }

Write a program to assign any value to any num and display the same through pointer

   1:  #include<stdio.h>
   2:  #include<conio.h>
   3:  #include<stdlib.h>
   4:  void main()
   5:  {
   6:  int x,i;
   7:  int *a_x;
   8:  x=rand();
   9:  a_x=&x;
  10:  printf("x=%d\n",*a_x);
  11:  getch();
  12:  }