Posts

Install Music Video-Multimedia at easy in Ubuntu Linux

Image
WE can install most of the restricted features in Ubuntu in a easy way.You just need to install restricted extras. Open terminal and type  sudo apt-get update sudo apt-get install ubuntu-restricted-extras

How To Install LEX and YACC in Linux or Ubuntu

Image
To program LEX programs and yacc programs you need to install two packages in Ubuntu 1:Flex -to make the Lex program work 2.Bison -to make the yacc programs work To install,Open terminal and do the following...  1.To install Flex sudo apt-get upgrade sudo apt-get install flex 2.To install Lex sudo apt-get upgrade sudo apt-get install bison And its done ..!!!

C Graphics Program For Boundary Fill in C

Image
C Graphics Program For Boundary Fill in C Source Code:- 1:  //Program to implement Boundary Fill Algorithm   2:  #include <graphics.h>   3:  #include <stdlib.h>   4:  #include <stdio.h>   5:  #include <conio.h>   6:  #include "grplib.h"   7:  int bfill(int x,int y,int f,int b)   8:       {   9:       if(getpixel(x,y) !=b && getpixel(x,y)!=f)   10:            {   11:            putpixel(x,y,f);   12:            bfill(x+1,y,f,b);   13:            bfill(x-1,y,f,b);   14:            bfill(x,y+1,f,b);   15:            bfill(x,y-1,f,b);   16:            }   17:       r...

C Graphics Program For 3D Transformation

Image
C Graphics Program For 3D Transformation Source Code:- 1:  //Program to implement 3D Transformation   2:  #include<math.h> 3:  #include<stdio.h> 4:  #include<process.h> 5:  #include<iostream.h> 6:  #include<conio.h> 7:  #include<graphics.h> 8:  #include "grplib.h" 9:  #define X 0 10:  #define Y 1 11:  int getx(float mat[4][1]) 12:       { 13:       return ceil(mat[0][0]); 14:       } 15:  int gety(float mat[4][1]) 16:       { 17:       return ceil(mat[1][0]); 18:       } 19:  int getz(float mat[4][1]) 20:       { 21:       return ceil(mat[2][0]); 22:       } 23:  void create_mat_pnt(float mat[4][1],int x,int y,int z) 24:       { 25:       mat[0][0]=x; 26:      ...

C Graphics Program For 2 D Transformation

Image
C Graphics Program For 2 D Transformation Source Code:- 1:  //Program to implement 2D Transformation   2:  #include<math.h> 3:  #include<stdio.h> 4:  #include<process.h> 5:  #include<iostream.h> 6:  #include<conio.h> 7:  #include<graphics.h> 8:  #include "grplib.h" 9:  #define X 0 10:  #define Y 1 11:  int getx(float mat[3][1]) 12:       { 13:       return ceil(mat[0][0]); 14:       } 15:  int gety(float mat[3][1]) 16:       { 17:       return ceil(mat[1][0]); 18:       } 19:  void create_mat_pnt(float mat[3][1],int x,int y) 20:       { 21:       mat[0][0]=x; 22:       mat[1][0]=y; 23:       mat[2][0]=1; 24:       } 25:  void create_mat_tran(float mat[3][3],int tx,int ty) 26...

Lex Program to find the Syntax of Scanf()

Image
Lex Program to find the Syntax of Scanf() Source Code:- 1:  %{   2:  #include<stdio.h> 3:  #include<ctype.h> 4:  int i=0,j=0; 5:  %} 6:  a "%d"|"%f"|"%c"|"%s" 7:  id [a-zA-Z][a-zA-Z0-9]* 8:  %% 9:  scanf\((\"({a}*|.*)*\"(,\&{id})*\))\; {for(i=0;i<yyleng;i++){if(yytext[i]=='%') 10:  j++; 11:  if(yytext[i]==',') 12:  j--; 13:  } 14:  if(j==0) 15:  printf("\ncorrect");   16:  else   17:  printf("incorrect"); 18:  } 19:  %% 20:  main() 21:  { yyin=fopen("file13.c","r"); 22:  yylex(); 23:  } 24:  int yywrap() 25:  {return 1; 26:  }      

Lex Program TO find Syntax of Printf()

Image
Lex Program TO find Syntax of Printf() Source Code:- 1:  %{   2:  #include<stdio.h>   3:  #include<ctype.h>   4:  int i=0,j=0;   5:  %}   6:  a "%d"|"%f"|"%c"|"%s"   7:  id [a-zA-Z][a-zA-Z0-9]*   8:  %%   9:  printf\((\"({a}*|.*)*\"(,{id})*\))\; {for(i=0;i<yyleng;i++){if(yytext[i]=='%')   10:  j++;   11:  if(yytext[i]==',')   12:  j--;   13:  }   14:  if(j==0)   15:  printf("\ncorrect");    16:  else    17:  printf("incorrect");   18:  }   19:  %%   20:  main()   21:  { yyin=fopen("file12.c","r");   22:  yylex();   23:  }   24:  int yywrap()   25:  {return 1;   26:  }