├── Autonomous ├── SIT │ ├── Sem1 │ │ ├── FCP │ │ │ ├── FCPLabManualV2.1.pdf │ │ │ ├── Manual │ │ │ │ ├── FCPLabManualV2.1.aux │ │ │ │ ├── FCPLabManualV2.1.log │ │ │ │ ├── FCPLabManualV2.1.pdf │ │ │ │ ├── FCPLabManualV2.1.synctex.gz │ │ │ │ ├── FCPLabManualV2.1.tex │ │ │ │ ├── FCPLabManualV2.1.toc │ │ │ │ ├── FCPLabManualV2.2.tex │ │ │ │ ├── cc-by-sa.png │ │ │ │ ├── gnu-gcc-cb.png │ │ │ │ ├── i-gnu-c3.png │ │ │ │ └── sitlogo.png │ │ │ ├── Programs │ │ │ │ ├── A01ShopSales.c │ │ │ │ ├── A02Sum2Digits.c │ │ │ │ ├── A03BoilingPoint.c │ │ │ │ ├── A04Quadratic.c │ │ │ │ ├── A05aCheckQuadrant.c │ │ │ │ ├── A05bSineAngle.c │ │ │ │ ├── A06PrintCalendar.c │ │ │ │ ├── A07AreaLogX.c │ │ │ │ ├── A08RecNCR.c │ │ │ │ ├── A09aFibonacci.c │ │ │ │ ├── A09bfnRecPow.c │ │ │ │ ├── A10BubbleBinary.c │ │ │ │ ├── A11InsertSelectSort.c │ │ │ │ ├── B01aArrayDiff.c │ │ │ │ ├── B01bDuplicate.c │ │ │ │ ├── B02TriMatrix.c │ │ │ │ ├── B03MatMul.c │ │ │ │ ├── B04LarSmallSwapPtr.c │ │ │ │ ├── B05SurfAreaVolCuboid.c │ │ │ │ ├── B06Caesar.c │ │ │ │ ├── B07StrSearch.c │ │ │ │ ├── B08MyStrCmp.c │ │ │ │ ├── B09Bowler.c │ │ │ │ ├── B10StructDist.c │ │ │ │ ├── B11BitMask.c │ │ │ │ └── a.out │ │ │ └── Syllabus │ │ │ │ └── FCPLabSyllabus2014-F.pdf │ │ └── OLD │ │ │ └── Lab │ │ │ ├── A01Quadratic.c │ │ │ ├── A02Calculator.c │ │ │ ├── A03Palindrome.c │ │ │ ├── A04RangePrime.c │ │ │ ├── A05SineAngle.c │ │ │ ├── A06Polynomial.c │ │ │ ├── A07EvenOddArr.c │ │ │ ├── A08BubbleSort1.c │ │ │ ├── A08BubbleSort2.c │ │ │ ├── A09IdentityMatrix.c │ │ │ ├── A10MyStringOps1.c │ │ │ ├── A11ConvertCase.c │ │ │ ├── A12Fibonacci.c │ │ │ ├── A12Fibonacci2.c │ │ │ ├── A13Reference.c │ │ │ ├── A14ArrayIdentical.c │ │ │ ├── B01Cosine.c │ │ │ ├── B02BinarySearch.c │ │ │ ├── B03ArrayUnion.c │ │ │ ├── B03ArrayUnion2.c │ │ │ ├── B04ArrayDiff.c │ │ │ ├── B05MatrixMul.c │ │ │ ├── B06TriangleMatrix.c │ │ │ ├── B07NameSort.c │ │ │ ├── B08SubString.c │ │ │ ├── B09fnMeanVarSd.c │ │ │ ├── B10fnSelectionSort.c │ │ │ ├── B11SumRowColMatrix.c │ │ │ ├── B12SearchChar.c │ │ │ ├── B13ReverseArray.c │ │ │ └── B14MyStrCpy.c │ └── Sem4 │ │ ├── AVL │ │ └── AVL.c │ │ ├── BFS │ │ └── BFS.cpp │ │ ├── BiCoefficient │ │ ├── BICOEFF.x │ │ └── BinomialCoeff.cpp │ │ ├── BinarySearch │ │ └── BinarySearch.c │ │ ├── DFS │ │ └── DFS.cpp │ │ ├── Dijkstra │ │ └── Dijkstra.cpp │ │ ├── Floyd │ │ └── Floyd.c │ │ ├── HEAPSORT │ │ ├── HeapPlot.dat │ │ ├── HeapPlot.gpl │ │ ├── HeapPlot.png │ │ ├── HeapSort.c │ │ └── OldHeapPlot.png │ │ ├── HORSPOOL │ │ └── Horspool.c │ │ ├── INSERTIONSORT │ │ ├── InsertionPlot.dat │ │ ├── InsertionPlot.gpl │ │ ├── InsertionPlot.png │ │ └── InsertionSort.c │ │ ├── KNAPSACK │ │ └── knapSack.cpp │ │ ├── Kruskal │ │ └── Kruskal.cpp │ │ ├── LinearSearch │ │ └── LinearSearch.c │ │ ├── MERGESORT │ │ ├── MergePlot.dat │ │ ├── MergePlot.gpl │ │ ├── MergePlot.png │ │ ├── MergeSort.c │ │ └── ParallelMergeSort.c │ │ ├── MaxMin │ │ └── MaxMin.c │ │ ├── NQUEENS │ │ ├── nQueens.cpp │ │ └── nQueens2.cpp │ │ ├── Prim │ │ └── Prim.cpp │ │ ├── QUICKSORT │ │ ├── .QuickPlot.gpl.swp │ │ ├── QuickPlot.dat │ │ ├── QuickPlot.gpl │ │ ├── QuickPlot.png │ │ └── QuickSort.c │ │ ├── SUBSET │ │ └── Subset.cpp │ │ ├── TOPOLOGICALSORT │ │ ├── Topological.eps │ │ ├── Topological.jpg │ │ ├── Topological.odg │ │ ├── TopologicalSorting.c │ │ ├── Warshall1.odg │ │ └── topo.jpeg │ │ └── WARSHALL │ │ ├── .c │ │ ├── Warshall.c │ │ ├── Warshall1.odg │ │ └── Warshall2.odg ├── Sem1 │ ├── Readme.txt │ └── Syllabus.md ├── Sem2 │ ├── Readme.txt │ └── Syllabus.md ├── Sem3 │ ├── Readme.txt │ └── Syllabus.md ├── Sem4 │ ├── Readme.txt │ └── Syllabus.md ├── Sem5 │ ├── Algorithms GCC │ │ ├── .gitignore │ │ ├── Bfs.cpp │ │ ├── DefectiveChessBoard.cpp │ │ ├── Dfs.cpp │ │ ├── Floyd.cpp │ │ └── Mergesort.cpp │ ├── DBMS Lab - MySQL │ │ ├── BANK_DB.SQL │ │ ├── BOOKDEALER_DB.SQL │ │ ├── INSURANCE_DB.SQL │ │ ├── ORDERPROCESSING.SQL │ │ ├── README.md │ │ └── STUDENT_DB.SQL │ ├── Readme.txt │ └── Syllabus.md ├── Sem6 │ ├── File Structures Lab │ │ ├── .gitignore │ │ ├── README.md │ │ ├── input-p1.txt │ │ ├── p1.cpp │ │ ├── p10.cpp │ │ ├── p11.cpp │ │ ├── p12.cpp │ │ ├── p2.cpp │ │ ├── p3.cpp │ │ ├── p4.cpp │ │ ├── p5.cpp │ │ ├── p6.cpp │ │ ├── p7.cpp │ │ ├── p8.cpp │ │ ├── p9.cpp │ │ └── reverse-p1.txt │ ├── Readme.txt │ └── Syllabus.md ├── Sem7 │ ├── Computer Networks Lab │ │ ├── pgm1 │ │ │ └── crc.c │ │ ├── pgm3 │ │ │ └── dvr.c │ │ ├── pgm4 │ │ │ ├── client.c │ │ │ └── server.c │ │ ├── pgm5 │ │ │ ├── client.c │ │ │ └── server.c │ │ ├── pgm6 │ │ │ └── rsa.c │ │ └── pgm8 │ │ │ └── leaky.c │ ├── Readme.txt │ └── Web Lab │ │ ├── README.md │ │ ├── Syllabus.md │ │ ├── pg1 │ │ ├── mystyles.css │ │ └── p1.html │ │ ├── pg10 │ │ ├── p10.html │ │ └── p10.pl │ │ ├── pg11 │ │ └── p11.php │ │ ├── pg12 │ │ └── p12.php │ │ ├── pg13 │ │ ├── 13.html │ │ ├── 13.php │ │ ├── 13b.html │ │ ├── 13b.php │ │ ├── commands.bash │ │ └── p13mysql.sql │ │ ├── pg14 │ │ ├── 14.html │ │ ├── 14.php │ │ ├── 14b.html │ │ ├── 14b.php │ │ ├── commands.bash │ │ ├── p14b.php │ │ └── p14mysql.sql │ │ ├── pg2 │ │ ├── p2a.html │ │ └── p2b.html │ │ ├── pg3 │ │ ├── p3a.html │ │ └── p3b.html │ │ ├── pg4 │ │ ├── p4a.html │ │ └── p4b.html │ │ ├── pg5 │ │ ├── p5a.html │ │ └── p5b.html │ │ ├── pg6 │ │ ├── p6a.xml │ │ ├── p6a.xsl │ │ ├── p6b.xml │ │ └── p6b.xsl │ │ ├── pg7 │ │ ├── p07a.pl │ │ ├── p07b.html │ │ └── p07b.pl │ │ ├── pg8 │ │ ├── count.txt │ │ ├── p08a.pl │ │ └── p08b.pl │ │ └── pg9 │ │ └── p09.pl └── Sem8 │ ├── Readme.txt │ └── Syllabus.md ├── Contributors.md ├── Foreword.md ├── LICENSE ├── README.md ├── VTU ├── Intro.md ├── Sem1_Sem2 │ ├── CPL2014 │ │ ├── 14cpl16.pdf │ │ ├── CPL0.5.pdf │ │ ├── Latex │ │ │ ├── CPL0.5.tex │ │ │ ├── cc-by-sa.png │ │ │ ├── fsmk_logo.png │ │ │ ├── gnu-gcc-cb.png │ │ │ └── i-gnu-c3.png │ │ ├── Programs │ │ │ ├── Updated Lab Set │ │ │ │ ├── 01Quadratic.c │ │ │ │ ├── 02Palindrome.c │ │ │ │ ├── 03aSquareRoot.c │ │ │ │ ├── 03bCheckLeapYear.c │ │ │ │ ├── 04Horner.c │ │ │ │ ├── 05SineAngle.c │ │ │ │ ├── 06BubbleBinary.c │ │ │ │ ├── 07MatrixMultiplication.c │ │ │ │ ├── 08NameSearch.c │ │ │ │ ├── 09String.c │ │ │ │ ├── 10ARightRotate.c │ │ │ │ ├── 10BisPrimefn.c │ │ │ │ ├── 11NcR.c │ │ │ │ ├── 12File.c │ │ │ │ ├── 13StudMarks.c │ │ │ │ ├── 14MeanStd.c │ │ │ │ ├── studentname.txt │ │ │ │ └── usn.txt │ │ │ ├── Older Programs │ │ │ │ ├── 06BubbleBinary.c │ │ │ │ ├── 10MatchAny.c │ │ │ │ ├── 12FileAppend.c │ │ │ │ ├── 14MeanStd.c │ │ │ │ ├── 14aPointerArrSum.c │ │ │ │ ├── 14bSumMalloc.c │ │ │ │ ├── 15aMedian.c │ │ │ │ └── 15bSmallest.c │ │ │ └── Revised Lab Set │ │ │ │ ├── 01Quadratic.c │ │ │ │ ├── 02Palindrome.c │ │ │ │ ├── 03aSquareRoot.c │ │ │ │ ├── 03bCheckLeapYear.c │ │ │ │ ├── 04Horner.c │ │ │ │ ├── 05SineAngle.c │ │ │ │ ├── 06BubbleBinary.c │ │ │ │ ├── 07MatrixMultiplication.c │ │ │ │ ├── 08NameSearch.c │ │ │ │ ├── 09String.c │ │ │ │ ├── 10ARightRotate.c │ │ │ │ ├── 10BisPrimefn.c │ │ │ │ ├── 11NcR.c │ │ │ │ ├── 12File.c │ │ │ │ ├── 13StudMarks.c │ │ │ │ ├── 14MeanStd.c │ │ │ │ ├── studentname.txt │ │ │ │ └── usn.txt │ │ └── SyllabusCPL.pdf │ ├── OLD2010 │ │ └── CPP_Lab │ │ │ ├── .old │ │ │ ├── 01Quadratic.c │ │ │ ├── 02GcdLcm.c │ │ │ ├── 03Palindrome.c │ │ │ ├── 04Horner.c │ │ │ ├── 05RemSpace.c │ │ │ ├── 06BinarySearch.c │ │ │ ├── 07BubbleSort.c │ │ │ ├── 08WordLength.c │ │ │ ├── 09Taylor.c │ │ │ ├── 11ParallelAddVector.c │ │ │ ├── 12RightRotate.c │ │ │ ├── 13isPrimefn.c │ │ │ ├── 14prime.c │ │ │ ├── 15StrRev.c │ │ │ └── 16MatchAny.c │ │ │ ├── 01Quadratic │ │ │ └── 01Quadratic.md │ │ │ ├── 02GcdLcm │ │ │ └── gcdlcm.md │ │ │ ├── 03Palindrome │ │ │ └── 03Palindrome.md │ │ │ ├── 04Horner │ │ │ └── 04Horner.md │ │ │ ├── 05Remspace │ │ │ └── 05Remspace.md │ │ │ ├── 06Binarysearch │ │ │ └── 06Binarysearch.md │ │ │ ├── 07Bubblesort │ │ │ └── 07Bubblesort.md │ │ │ ├── 08WordLength │ │ │ └── 08WordLength.md │ │ │ ├── 09Taylor │ │ │ └── Taylor.md │ │ │ ├── 10Matrixmul │ │ │ └── Matrixmul.md │ │ │ ├── 11ParallelAddVector │ │ │ └── 11parallelAddVector.md │ │ │ ├── 11ParallelProg │ │ │ └── 11parallelAddVector.md │ │ │ ├── 12Rightrotate │ │ │ └── 12rightrotate.md │ │ │ ├── 13isPrimefn │ │ │ └── 13isprimefn.md │ │ │ ├── 14Prime │ │ │ └── prime.md │ │ │ ├── 15Revstring │ │ │ └── 15Revstring.md │ │ │ ├── 16Matchany │ │ │ └── Matchany.md │ │ │ ├── CPL.pdf │ │ │ ├── Syllabus.md │ │ │ └── output │ │ │ └── audit.txt │ └── Readme.txt ├── Sem3 │ ├── DS_Lab │ │ ├── .old │ │ │ ├── 10_heap.c │ │ │ ├── 11_doublyLinkList.c │ │ │ ├── 12_date.cpp │ │ │ ├── 13_octal.cpp │ │ │ ├── 14_binaryTree.cpp │ │ │ ├── 1_polynomial.c │ │ │ ├── 2_PostfixConversion.c │ │ │ ├── 3_evaluate_post.c │ │ │ ├── 4_Queue.c │ │ │ ├── 5_employee.cpp │ │ │ ├── 6_String.cpp │ │ │ ├── 7_stack.cpp │ │ │ ├── 8_list.cpp │ │ │ └── 9_sparse.c │ │ ├── 00 │ │ │ └── Introduction_to_GCC.md │ │ ├── 01Polynomial │ │ │ └── 01Polynomial.md │ │ ├── 02PostfixConversion │ │ │ └── 02PostfixConversion.md │ │ ├── 03EvaluatePost │ │ │ └── 03EvaluatePost.md │ │ ├── 04Queue │ │ │ └── 04Queue.md │ │ ├── 05Employee │ │ │ └── 05Employee.md │ │ ├── 06String │ │ │ └── 06String.md │ │ ├── 07Stack │ │ │ └── 07Stack.md │ │ ├── 08List │ │ │ ├── 08List.md │ │ │ └── singlylist.png │ │ ├── 09Sparse │ │ │ └── 09Sparse.md │ │ ├── 10Heap │ │ │ └── 10Heap.md │ │ ├── 11DoubleLinkList │ │ │ └── 11DoubleLinkList.md │ │ ├── 12Date │ │ │ └── 12Date.md │ │ ├── 13Octal │ │ │ └── 13Octal.md │ │ ├── 14BinaryTree │ │ │ └── 14BinaryTree.md │ │ └── Syllabus.md │ ├── ElectronicCircuits_Lab │ │ ├── ElectronicCircuits_Lab.md │ │ └── Syllabus.md │ ├── LogicDesign_Lab │ │ ├── 8:1_multiplexer │ │ ├── LogicDesign_Lab.md │ │ ├── d_flip_flop │ │ ├── mod_8 │ │ └── tail_counter │ └── Readme.txt ├── Sem4 │ ├── ADA_Lab │ │ ├── .old │ │ │ ├── 01QuickSort │ │ │ │ ├── QuickPlot.dat │ │ │ │ ├── QuickPlot.gpl │ │ │ │ ├── QuickPlot.png │ │ │ │ ├── QuickSort.c │ │ │ │ └── QuickSort.cpp │ │ │ ├── 03aTopologicalOrdering │ │ │ │ └── TopologicalSorting.c │ │ │ ├── 03bWarshall-s-Algorithm │ │ │ │ └── Warshall.c │ │ │ ├── 04Knapsack │ │ │ │ └── KnapSack.cpp │ │ │ ├── 05Dijkstra-s-Algorithm │ │ │ │ └── Dijkstra.cpp │ │ │ ├── 06Kruskal │ │ │ │ └── Kruskal.cpp │ │ │ ├── 07aBFS │ │ │ │ └── BFS.cpp │ │ │ ├── 07bDFS │ │ │ │ └── DFS.cpp │ │ │ ├── 08Subset-Sum │ │ │ │ └── SubSet.cpp │ │ │ ├── 09TSP │ │ │ │ └── TSP.cpp │ │ │ ├── 10Prim-s-Algorithm │ │ │ │ └── Prim.cpp │ │ │ └── 12NQueens │ │ │ │ └── NQueens.cpp │ │ ├── 01QuickSort │ │ │ ├── QuickPlot.png │ │ │ └── quickc.md │ │ ├── 02MergeSortParallelized │ │ │ ├── 02mergesort.md │ │ │ └── mergesort.png │ │ ├── 03aTopologicalOrdering │ │ │ └── 03aTopologicalOrdering.md │ │ ├── 03bWarshall-s-Algorithm │ │ │ └── 03bWarshall-s-Algorithm.md │ │ ├── 04Knapsack │ │ │ └── 04Knapsack.md │ │ ├── 05Dijkstra-s-Algorithm │ │ │ └── 05Dijkstra-s-Algorithm.md │ │ ├── 06Kruskal │ │ │ └── 06Kruskal.md │ │ ├── 07aBFS │ │ │ └── 07aBFS.md │ │ ├── 07bDFS │ │ │ └── 07bDFS.md │ │ ├── 08Subset-Sum │ │ │ └── 08Subset-Sum.md │ │ ├── 09TSP │ │ │ └── 09TSP.md │ │ ├── 10Prim-s-Algorithm │ │ │ └── 10Prim-s-Algorithm.md │ │ ├── 11Floyd-s-Algorithm │ │ │ └── 11Floyd-s-Algorithm.md │ │ ├── 12NQueens │ │ │ └── 12NQueens.md │ │ ├── ADA.pdf │ │ └── Syllabus.md │ ├── MP_Lab │ │ ├── MP_Lab.md │ │ └── Syllabus.md │ └── Readme.txt ├── Sem5 │ ├── DB_Lab │ │ ├── .old │ │ │ ├── All_in_one │ │ │ ├── Question1 │ │ │ │ ├── 1_create.sql │ │ │ │ ├── 1_insert.sql │ │ │ │ ├── 1_query1.sql │ │ │ │ ├── 1_query2.sql │ │ │ │ ├── 1_query3.sql │ │ │ │ ├── 1_query4.sql │ │ │ │ └── 1_query5.sql │ │ │ ├── Question2 │ │ │ │ ├── 2i_create.sql │ │ │ │ ├── 2i_insert.sql │ │ │ │ ├── 2i_query1.sql │ │ │ │ ├── 2i_query2.sql │ │ │ │ ├── 2i_query3.sql │ │ │ │ ├── 2i_query4.sql │ │ │ │ ├── 2i_query5.sql │ │ │ │ └── 2i_query6.sql │ │ │ ├── Question3 │ │ │ │ ├── 3i_create.sql │ │ │ │ ├── 3ii_insert.sql │ │ │ │ ├── 3iii_soln.sql │ │ │ │ ├── 3iv_soln.sql │ │ │ │ └── 3v_soln.sql │ │ │ ├── Question4 │ │ │ │ ├── 4i_create.sql │ │ │ │ ├── 4ii_insert.sql │ │ │ │ ├── 4iii_soln.sql │ │ │ │ ├── 4iv_soln.sql │ │ │ │ └── 4v_soln.sql │ │ │ └── Question5 │ │ │ │ ├── 5i_create.sql │ │ │ │ ├── 5ii_insert.sql │ │ │ │ ├── 5iii_soln.sql │ │ │ │ ├── 5iv_soln.sql │ │ │ │ └── 5v_soln.sql │ │ ├── 00_Introduction_to_MySQL │ │ │ ├── DBScreenShots │ │ │ │ ├── 1.png │ │ │ │ ├── 2.png │ │ │ │ ├── 3.png │ │ │ │ ├── 4.png │ │ │ │ ├── 5.png │ │ │ │ └── 6.png │ │ │ └── Introduction_to_MySQL.md │ │ ├── 01_StudentClass │ │ │ └── 01_StudentClass.md │ │ ├── 02_AirlineFlight │ │ │ └── 02_AirlineFlight.md │ │ ├── 03_StudentCoursesBooks │ │ │ └── 03_StudentCoursesBooks.md │ │ ├── 04_BookDealer │ │ │ └── 04_BookDealer.md │ │ ├── 05_BankingEnterprise │ │ │ └── 05_BankingEnterprise.md │ │ ├── About.md │ │ ├── Back.md │ │ ├── Content.md │ │ ├── Contributors.md │ │ ├── DB_CSE_5thSem.pdf │ │ ├── Foreword.md │ │ ├── README.md │ │ ├── SUMMARY.md │ │ ├── SYLLABUS.md │ │ ├── back.png │ │ └── cover.png │ ├── Readme.txt │ └── SS_OS_Lab │ │ ├── .old │ │ ├── 10.c │ │ ├── 11.c │ │ ├── 1a.l │ │ ├── 1b.l │ │ ├── 2a.l │ │ ├── 2b.l │ │ ├── 3.l │ │ ├── 4a.l │ │ ├── 4a.y │ │ ├── 4b.l │ │ ├── 4b.y │ │ ├── 5a.l │ │ ├── 5a.y │ │ ├── 5b.l │ │ ├── 5b.y │ │ ├── 6.l │ │ ├── 6.y │ │ ├── 7a.sh │ │ ├── 7b.c │ │ ├── 8a.sh │ │ ├── 8b.c │ │ ├── 9a.sh │ │ ├── 9b.c │ │ ├── bankers.c │ │ ├── few_pgms │ │ ├── first_10 │ │ └── fw_pgms │ │ ├── 01aCharacterCount │ │ └── 01aCharacterCount.md │ │ ├── 01bCommentLines │ │ └── 01bCommentLines.md │ │ ├── 02aRecognizeIdentifiers │ │ └── 02aRecognizeIdentifiers.md │ │ ├── 02bRecognizeSentence │ │ └── 02bRecognizeSentence.md │ │ ├── 03IdentifierCount │ │ └── 03IdentifierCount.md │ │ ├── 04aRecognizeOperators │ │ └── 04aRecognizeOperators.md │ │ ├── 04bRecognizeVariable │ │ └── 04bRecognizeVariable.md │ │ ├── 05aEvaluateExpression │ │ └── 05aEvaluateExpression.md │ │ ├── 05bRecognizeStrings │ │ └── 05bRecognizeStrings.md │ │ ├── 06RecognizeGrammar │ │ └── 06RecognizeGrammar.md │ │ ├── 07aReverseOrder │ │ └── 07aReverseOrder.md │ │ ├── 07bShellLikeProgram │ │ └── 07bShellLikeProgram.md │ │ ├── 08aFilePermission │ │ └── 08aFilePermission.md │ │ ├── 08bFileHandle │ │ └── 08bFileHandle.md │ │ ├── 09aBundleScript │ │ └── 09aBundleScript.md │ │ ├── 09bChildProcessIDs │ │ └── 09bChildProcessIDs.md │ │ ├── 10RoundRobinAlgorithm │ │ └── 10RoundRobinAlgorithm.md │ │ ├── 11MultiThreadedFibonacciSeries │ │ └── 11MultiThreadedFibonacciSeries.md │ │ ├── 12BankersAlgorithm │ │ └── 12BankersAlgorithm.md │ │ └── Syllabus.md ├── Sem6 │ ├── CG_Lab │ │ ├── 01Sierpanski │ │ │ └── sierpanski.md │ │ ├── 02LiangBasky │ │ │ ├── liang.png │ │ │ ├── liangAlgo.png │ │ │ └── liangbasky.md │ │ ├── 03SpinCube │ │ │ ├── spinCube.md │ │ │ └── spincube.png │ │ ├── 04RotateHouse │ │ │ ├── houserotate.md │ │ │ └── rthouse.png │ │ ├── 05CohenSutherland │ │ │ ├── cohen.png │ │ │ └── cohensutherland.md │ │ ├── 06parallelopiped │ │ │ ├── parallelopiped.md │ │ │ └── parallelopiped.png │ │ ├── 07teapot │ │ │ ├── teapot.md │ │ │ └── teapot.png │ │ ├── 08moveCube │ │ │ ├── movecube.md │ │ │ └── movecube.png │ │ ├── 09scanFill │ │ │ ├── scanfill.md │ │ │ └── scanfill.png │ │ ├── 10rectMesh │ │ │ ├── mesh.md │ │ │ └── mesh.png │ │ ├── CG.pdf │ │ └── Syllabus.md │ ├── Readme.txt │ └── USP_CD_Lab │ │ ├── .old │ │ ├── C_files │ │ │ ├── 01_get_limits.cpp │ │ │ ├── 02_posix_configuration.cpp │ │ │ ├── 03_file_lock.c │ │ │ ├── 04_ipc_fifo_reader.cpp │ │ │ ├── 04_ipc_fifo_writer.cpp │ │ │ ├── 06_race_condition.c │ │ │ ├── 07_zombie.c │ │ │ ├── 08_avoid_zombie.c │ │ │ ├── 09_my_system.c │ │ │ └── 10_alarm_signal_handler.c │ │ └── usp-lab-07 │ │ │ ├── usp-lab-07.md │ │ │ └── usp-lab-07.png │ │ ├── 01GetLimits │ │ ├── 01.md │ │ └── usp-lab-01.png │ │ ├── 02PosixConfiguration │ │ ├── 02_output.png │ │ └── 02_posix_configuration.md │ │ ├── 03FileLock │ │ ├── 03.html │ │ ├── 03_file_lock.c │ │ ├── 03_file_lock.md │ │ ├── out1.png │ │ ├── out2.png │ │ └── out3.png │ │ ├── 04IpcFifoReader │ │ ├── 04.html │ │ ├── 04_ipc_fifo_reader.md │ │ ├── pipe.png │ │ └── usp-lab-04.png │ │ ├── 05aEnvironList │ │ ├── 05a.html │ │ ├── 5a_environlist.c │ │ ├── 5a_environlist.md │ │ ├── out1.png │ │ └── out2.png │ │ ├── 05bUnixLnCommand │ │ ├── 05b.html │ │ ├── 5b_unix_ln-command.c │ │ ├── 5b_unix_ln-command.md │ │ └── output5b.png │ │ ├── 06RaceCondition │ │ ├── 06.html │ │ ├── 06_race_condition.md │ │ ├── usp-lab-06a.png │ │ └── usp-lab-06b.png │ │ ├── 07CreateZombie │ │ ├── 07.html │ │ ├── usp-lab-07.md │ │ └── usp-lab-07.png │ │ ├── 08AvoidZombie │ │ ├── 08.html │ │ ├── 08_avoid_zombie.md │ │ └── usp-lab-08.png │ │ ├── 09MySystem │ │ ├── 09.html │ │ ├── 09_my_system.c │ │ ├── 09_my_system.md │ │ └── output.png │ │ ├── 10AlarmSignalHandler │ │ ├── 10.html │ │ ├── 10_alarm_signal_handler.c │ │ ├── 10_alarm_signal_handler.md │ │ └── Output.png │ │ ├── 11SyntaxDirectedDefinition │ │ ├── a.out │ │ ├── sdd_cd.c │ │ ├── sdd_cd.html │ │ ├── sdd_cd.md │ │ └── sdd_cd.png │ │ ├── 12RegularExpression │ │ ├── trial.y │ │ ├── y.tab.c │ │ ├── y.tab.h │ │ ├── yacc_regular.html │ │ ├── yacc_regular.md │ │ ├── yacc_regular.png │ │ └── yacc_regular.y │ │ ├── Syllabus.md │ │ └── USP.pdf └── Sem7 │ ├── Networks_Lab │ ├── .old │ │ └── All_in_one_c_programs │ ├── 03PingMessages │ │ ├── 03PingMessages.md │ │ ├── 3_1.png │ │ ├── 3_2.png │ │ └── 3_3.png │ ├── 07CRC16Bit │ │ ├── CRC.md │ │ └── crc.png │ ├── 08DistanceVector │ │ ├── DSV.md │ │ └── dsv.png │ ├── 09ClientServer │ │ ├── 9.md │ │ └── 9.png │ ├── 10FifoClientServer │ │ ├── client.png │ │ ├── client_server.md │ │ └── server.png │ ├── 11RSA │ │ ├── rsa.md │ │ └── rsa.png │ ├── 12LeakyBucket │ │ ├── LeakyBucket.md │ │ ├── leakybucket1.png │ │ ├── leakybucket2.png │ │ └── leakybucket3.png │ └── Syllabus.md │ ├── Readme.txt │ ├── WP_Lab.zip │ └── WP_Lab │ ├── 010_Session │ ├── 10.md │ └── 10.png │ ├── 01_Fibonacci_Squares │ ├── 1.md │ ├── 1a_1.png │ ├── 1a_2.png │ ├── 1a_3.png │ ├── 1a_4.png │ └── 1b.png │ ├── 02_USN_SEM │ ├── 2.md │ ├── 2a_1.png │ ├── 2a_2.png │ ├── 2b_1.png │ ├── 2b_2.png │ └── 2b_3.png │ ├── 03_StackOrdering │ ├── 3.md │ ├── 3a.png │ └── 3b.png │ ├── 04_StudentInfo │ ├── 4.md │ └── 4.png │ ├── 05_ServerInfo_UnixCommand │ ├── 5.md │ ├── 5a_1.png │ ├── 5a_2.png │ ├── 5b_1.png │ ├── 5b_2.png │ └── 5b_3.png │ ├── 06_Greeting_TrackVisitors │ ├── 6.md │ ├── 6a_1.png │ ├── 6a_2.png │ ├── 6a_3.png │ ├── 6a_4.png │ └── 6b.png │ ├── 07_DigitalClock │ ├── 7.md │ └── 7.png │ ├── 08_PerlMySQl │ ├── 8.md │ └── 8.png │ ├── 09_Cookie │ ├── 9.md │ └── 9.png │ ├── 11_PhpMySQl │ ├── 11.md │ ├── 11_1.png │ └── 11_2.png │ ├── 12_RailsApplication │ ├── 12.md │ ├── 12_1.png │ ├── 12_2.png │ ├── 12_3.png │ ├── books_controller.rb │ ├── index.html.erb │ ├── l5_pages.png │ ├── l6_block_dia_vc.png │ ├── routes.rb │ └── search.html.erb │ └── Syllabus.md └── manual /Autonomous/SIT/Sem1/FCP/FCPLabManualV2.1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/Autonomous/SIT/Sem1/FCP/FCPLabManualV2.1.pdf -------------------------------------------------------------------------------- /Autonomous/SIT/Sem1/FCP/Manual/FCPLabManualV2.1.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/Autonomous/SIT/Sem1/FCP/Manual/FCPLabManualV2.1.log -------------------------------------------------------------------------------- /Autonomous/SIT/Sem1/FCP/Manual/FCPLabManualV2.1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/Autonomous/SIT/Sem1/FCP/Manual/FCPLabManualV2.1.pdf -------------------------------------------------------------------------------- /Autonomous/SIT/Sem1/FCP/Manual/FCPLabManualV2.1.synctex.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/Autonomous/SIT/Sem1/FCP/Manual/FCPLabManualV2.1.synctex.gz -------------------------------------------------------------------------------- /Autonomous/SIT/Sem1/FCP/Manual/cc-by-sa.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/Autonomous/SIT/Sem1/FCP/Manual/cc-by-sa.png -------------------------------------------------------------------------------- /Autonomous/SIT/Sem1/FCP/Manual/gnu-gcc-cb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/Autonomous/SIT/Sem1/FCP/Manual/gnu-gcc-cb.png -------------------------------------------------------------------------------- /Autonomous/SIT/Sem1/FCP/Manual/i-gnu-c3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/Autonomous/SIT/Sem1/FCP/Manual/i-gnu-c3.png -------------------------------------------------------------------------------- /Autonomous/SIT/Sem1/FCP/Manual/sitlogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/Autonomous/SIT/Sem1/FCP/Manual/sitlogo.png -------------------------------------------------------------------------------- /Autonomous/SIT/Sem1/FCP/Programs/A03BoilingPoint.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main(void) 5 | { 6 | float fBoilPt; 7 | 8 | printf("\nEnter Boiling point of the substance\n"); 9 | scanf("%f",&fBoilPt); 10 | 11 | if (0.95*100 <= fBoilPt && fBoilPt <= 1.05*100) 12 | printf("\nThe substance is Water\n"); 13 | else if (0.95*357 <= fBoilPt && fBoilPt <= 1.05*357) 14 | printf("\nThe substance is Mercury\n"); 15 | else if (0.95*1187 <= fBoilPt && fBoilPt <= 1.05*1187) 16 | printf("\nThe substance is Copper\n"); 17 | else if (0.95*2193 <= fBoilPt && fBoilPt <= 1.05*2193) 18 | printf("\nThe substance is Silver\n"); 19 | else if (0.95*2660 <= fBoilPt && fBoilPt <= 1.05*2660) 20 | printf("\nThe substance is Gold\n"); 21 | else 22 | printf("\nInvalid Substance\n"); 23 | return 0; 24 | } 25 | /* 26 | $ ./a.out 27 | 28 | Enter Boiling point of the substance 29 | 102 30 | 31 | The substance is Water 32 | $ ./a.out 33 | 34 | Enter Boiling point of the substance 35 | 365 36 | 37 | The substance is Mercury 38 | $ ./a.out 39 | 40 | Enter Boiling point of the substance 41 | 1200 42 | 43 | The substance is Copper 44 | $ ./a.out 45 | 46 | Enter Boiling point of the substance 47 | 2205 48 | 49 | The substance is Silver 50 | $ ./a.out 51 | 52 | Enter Boiling point of the substance 53 | 2670 54 | 55 | The substance is Gold 56 | $ ./a.out 57 | 58 | Enter Boiling point of the substance 59 | 3333 60 | 61 | Invalid Substance 62 | 63 | */ 64 | -------------------------------------------------------------------------------- /Autonomous/SIT/Sem1/FCP/Programs/A05bSineAngle.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #define PI 3.1416 5 | 6 | int main(void) 7 | { 8 | float fAngD, fAngR; 9 | float fTerm, fNum, fDen, fVal; 10 | int i,iNum; 11 | 12 | printf("Enter the Angle ....\n"); 13 | scanf("%f",&fAngD); 14 | 15 | printf("Angle = %g\n",fAngD); 16 | 17 | printf("Enter the Number of terms...\n"); 18 | scanf("%d",&iNum); 19 | printf("No of terms = %d\n",iNum); 20 | 21 | fAngR= (fAngD*PI)/180 ; 22 | 23 | fNum=fAngR; 24 | fDen=1.0; 25 | fVal =0.0; 26 | fTerm=fNum/fDen; 27 | for(i=1;i<=iNum;i++) 28 | { 29 | fVal = fVal + fTerm; 30 | fNum = -fNum * fAngR * fAngR ; 31 | fDen = fDen * (2*i) * (2*i+1); 32 | fTerm = fNum/fDen; 33 | } 34 | printf(" Calculated value is :sin(%g) = %g\n",fAngD,fVal); 35 | printf("Built In function value is :sin(%g) = %g\n",fAngD, sin(fAngR)); 36 | return 0; 37 | } 38 | /* 39 | $ ./a.out 40 | Enter the Angle .... 41 | 60 42 | Angle = 60 43 | Enter the Number of terms... 44 | 3 45 | No of terms = 3 46 | Calculated value is :sin(60) = 0.866297 47 | Built In function value is :sin(60) = 0.866027 48 | $ ./a.out 49 | Enter the Angle .... 50 | 60 51 | Angle = 60 52 | Enter the Number of terms... 53 | 8 54 | No of terms = 8 55 | Calculated value is :sin(60) = 0.866027 56 | Built In function value is :sin(60) = 0.866027 57 | $ ./a.out 58 | Enter the Angle .... 59 | 90 60 | Angle = 90 61 | Enter the Number of terms... 62 | 8 63 | No of terms = 8 64 | Calculated value is :sin(90) = 1 65 | Built In function value is :sin(90) = 1 66 | */ 67 | -------------------------------------------------------------------------------- /Autonomous/SIT/Sem1/FCP/Programs/A07AreaLogX.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | double fnAreaTrapezoid(double, double, double); 6 | 7 | int main(void) 8 | { 9 | double i, dDx=0.1,dX1,dX2,dY1,dY2; 10 | double dLeft, dRight, dArea=0.0, dTotArea=0.0; 11 | 12 | printf("\nEnter the left and right limit\n"); 13 | scanf("%lf%lf", &dLeft, &dRight); 14 | 15 | printf("\nEnter the increment dx\n"); 16 | scanf("%lf", &dDx); 17 | 18 | for(i=dLeft;i 2 | #include 3 | 4 | int fnFactorial(int); 5 | 6 | int main(void) 7 | { 8 | int iN,iR,iNCR; 9 | printf("\nEnter the value of n\n"); 10 | scanf("%d", &iN); 11 | printf("\nEnter the value of r\n"); 12 | scanf("%d", &iR); 13 | 14 | if(iN < iR) 15 | { 16 | printf("\nnCr does not exist\n"); 17 | exit(0); 18 | } 19 | 20 | iNCR = (fnFactorial(iN)/(fnFactorial(iR)*fnFactorial(iN-iR))); 21 | 22 | printf("\nFor n = %d and r = %d, %dC%d = %d\n", iN ,iR, iN, iR, iNCR); 23 | return 0; 24 | } 25 | 26 | int fnFactorial(int iVal) 27 | { 28 | if(0 == iVal) 29 | return 1; 30 | else 31 | return (iVal * fnFactorial(iVal - 1)); 32 | } 33 | 34 | /* 35 | $ ./a.out 36 | 37 | Enter the value of n 38 | 3 6 39 | 40 | Enter the value of r 41 | 42 | nCr does not exist 43 | 44 | $ ./a.out 45 | 46 | Enter the value of n 47 | 5 2 48 | 49 | Enter the value of r 50 | 51 | For n = 5 and r = 2, 5C2 = 10 52 | 53 | $ ./a.out 54 | 55 | Enter the value of n 56 | 7 5 57 | 58 | Enter the value of r 59 | 60 | For n = 7 and r = 5, 7C5 = 21 61 | */ 62 | -------------------------------------------------------------------------------- /Autonomous/SIT/Sem1/FCP/Programs/A09aFibonacci.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int fnFibonacci(int); 5 | 6 | int main(void) 7 | { 8 | int iTerm, i, iNum; 9 | 10 | printf("Enter the no of terms\n"); 11 | scanf("%d", &iNum); 12 | 13 | printf("\nThe terms in the Fibonacci Sequence:\n"); 14 | //printf("\nThe terms in the Fibonacci Sequence:\n%d\t%d\t",0,1); 15 | for(i=0;i 2 | #include 3 | 4 | int fnRecPow(int, int); 5 | int main(void) 6 | { 7 | int iX, iN; 8 | float fRes; 9 | printf("\n Enter value of x and n\n"); 10 | scanf("%d%d", &iX, &iN); 11 | 12 | if(iN<0) 13 | { 14 | fRes = 1.0/fnRecPow(iX,-iN); 15 | } 16 | else 17 | { 18 | fRes = fnRecPow(iX,iN); 19 | } 20 | printf("\n%d raised to the power %d is %d\n",iX, iN, fRes); 21 | return 0; 22 | } 23 | 24 | int fnRecPow(int iX, int iN) 25 | { 26 | if(0==iN) 27 | return 1; 28 | else if(1 == iN) 29 | return iX; 30 | else 31 | return (iX * fnRecPow(iX, iN-1)); 32 | } 33 | -------------------------------------------------------------------------------- /Autonomous/SIT/Sem1/FCP/Programs/B01bDuplicate.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main(void) 5 | { 6 | int iaA[10], iNum; 7 | int i, j; 8 | 9 | printf("\nEnter no of elements in Array \n"); 10 | scanf("%d",&iNum); 11 | 12 | printf("\nEnter %d elements in Array A\n",iNum); 13 | for(i=0;i 2 | #include 3 | 4 | int main(void) 5 | { 6 | int iaMat[100][100],iRow,iCol,i,j; 7 | 8 | printf("\nEnter the order of the matrix\n"); 9 | scanf("%d%d",&iRow,&iCol); 10 | 11 | if(iRow != iCol) 12 | { 13 | printf("\nMatrix should be a Square Matrix\n"); 14 | exit(0); 15 | } 16 | for(i=0;i 2 | #include 3 | 4 | int main(void) 5 | { 6 | int iaList[50], iNum, i, j, iTemp, iPos; 7 | int *iPtr1,*iPtr2; 8 | 9 | iPtr1 = iPtr2 = iaList; 10 | printf("\nEnter the value of n : "); 11 | scanf("%d", &iNum); 12 | 13 | printf("\nEnter the elements: "); 14 | for(i=0;i *iPtr2) 26 | { 27 | iPtr2 = &iaList[i]; 28 | } 29 | } 30 | 31 | printf("\nArray elements before swapping the largest and smallest elements\n"); 32 | for(i=0;i 2 | #include 3 | 4 | void fnCalcVolSurfArea(int, int, int, int*, int*); 5 | int main(void) 6 | { 7 | int iLength, iBreadth, iHeight, iSurfArea, iVolume; 8 | 9 | printf("\nEnter the length, breadth and height of the cuboid\n"); 10 | scanf("%d%d%d", &iLength, &iBreadth, &iHeight); 11 | 12 | fnCalcVolSurfArea(iLength, iBreadth, iHeight, &iSurfArea, &iVolume); 13 | 14 | printf("\nSurface Area of cuboid is %d units\n", iSurfArea); 15 | printf("\nVolume of cuboid is %d cubic units\n", iVolume); 16 | return 0; 17 | } 18 | 19 | void fnCalcVolSurfArea(int iL, int iB, int iH, int *iA, int *iV) 20 | { 21 | *iA = 2*iL*iB + 2*iB*iH + 2*iH*iL; 22 | *iV = iL*iB*iH; 23 | } 24 | 25 | /* 26 | $ ./a.out 27 | 28 | Enter the length, breadth and height of the cuboid 29 | 3 4 5 30 | 31 | Surface Area of cuboid is 94 units 32 | 33 | Volume of cuboid is 60 cubic units 34 | $ ./a.out 35 | 36 | Enter the length, breadth and height of the cuboid 37 | 6 6 6 38 | 39 | Surface Area of cuboid is 216 units 40 | 41 | Volume of cuboid is 216 cubic units 42 | */ 43 | 44 | -------------------------------------------------------------------------------- /Autonomous/SIT/Sem1/FCP/Programs/B07StrSearch.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int main() 6 | { 7 | char acText[100], acPattern[10]; 8 | int iCount; 9 | char *pos = NULL, *start = NULL; 10 | printf("\nEnter the text\n"); 11 | gets(acText); 12 | 13 | printf("\nEnter the substring to search for\n"); 14 | gets(acPattern); 15 | 16 | start = acText; 17 | while((pos = strstr(start, acPattern))) 18 | { 19 | 20 | iCount++; 21 | printf("\nSubstring found at position %ld\n", pos-acText+1); 22 | start = pos+1; 23 | } 24 | 25 | printf("\nNo of occurences is %d\n", iCount); 26 | 27 | return 0; 28 | } 29 | 30 | /* 31 | $ ./a.out 32 | 33 | Enter the text 34 | The cat with five legs ran down the hall 35 | 36 | Enter the substring to search for 37 | he 38 | 39 | Substring found at position 2 40 | 41 | Substring found at position 34 42 | 43 | No of occurences is 2 44 | 45 | $ ./a.out 46 | 47 | Enter the text 48 | Freedom of the mind 49 | 50 | Enter the substring to search for 51 | faith 52 | 53 | No of occurences is 0 54 | */ 55 | 56 | -------------------------------------------------------------------------------- /Autonomous/SIT/Sem1/FCP/Programs/B10StructDist.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | typedef struct 6 | { 7 | int iXcor, iYcor; 8 | }POINT; 9 | 10 | 11 | int main(void) 12 | { 13 | POINT p1, p2; 14 | 15 | float fDistance; 16 | 17 | int iDiffX,iDiffY; 18 | 19 | printf("\nEnter coordinates of the first point\n"); 20 | scanf("%d%d",&p1.iXcor,&p1.iYcor); 21 | 22 | printf("\nEnter coordinates of the second point\n"); 23 | scanf("%d%d",&p2.iXcor,&p2.iYcor); 24 | 25 | iDiffX = p2.iXcor - p1.iXcor; 26 | iDiffY = p2.iYcor - p1.iYcor; 27 | 28 | fDistance = sqrt(((iDiffX)*(iDiffX)) + ((iDiffY)*(iDiffY))); 29 | 30 | printf("\nDistance between the two points is %g units\n",fDistance); 31 | 32 | return 0; 33 | } 34 | 35 | /* 36 | 37 | $ ./a.out 38 | 39 | Enter coordinates of the first point 40 | 0 0 41 | 42 | Enter coordinates of the second point 43 | 5 0 44 | 45 | Distance between the two points is 5 units 46 | $ ./a.out 47 | 48 | Enter coordinates of the first point 49 | 5 5 50 | 51 | Enter coordinates of the second point 52 | 5 9 53 | 54 | Distance between the two points is 4 units 55 | $ ./a.out 56 | 57 | Enter coordinates of the first point 58 | 1 1 59 | 60 | Enter coordinates of the second point 61 | 6 7 62 | 63 | Distance between the two points is 7.81025 units 64 | */ 65 | 66 | -------------------------------------------------------------------------------- /Autonomous/SIT/Sem1/FCP/Programs/B11BitMask.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | unsigned short fnSetBit(unsigned short, unsigned short); 5 | unsigned short fnMaskBit(unsigned short, unsigned short); 6 | 7 | int main(void) 8 | { 9 | unsigned short uNum,uPos; 10 | 11 | printf("\nEnter a value\n"); 12 | scanf("%hu",&uNum); 13 | 14 | printf("\nEnter bit uPosition (1-16) to set to one\n"); 15 | scanf("%hu",&uPos); 16 | 17 | uNum = fnSetBit(uNum, uPos); 18 | 19 | printf("\nValue after setting the specified bit = %hu\n",uNum); 20 | 21 | printf("\nEnter a value\n"); 22 | scanf("%hu",&uNum); 23 | 24 | printf("\nEnter bit uPosition (1-16) to mask to zero\n"); 25 | scanf("%hu",&uPos); 26 | 27 | uNum = fnMaskBit(uNum, uPos); 28 | 29 | printf("\nValue after masking the specified bit = %hu\n",uNum); 30 | 31 | return 0; 32 | } 33 | 34 | unsigned short fnSetBit(unsigned short uVal, unsigned short uPos) 35 | { 36 | unsigned short uMask=1; 37 | uMask = uMask << (uPos-1); 38 | uVal = uVal | uMask; 39 | return uVal; 40 | } 41 | unsigned short fnMaskBit(unsigned short uVal, unsigned short uPos) 42 | { 43 | unsigned short uMask=1; 44 | uMask = uMask << (uPos-1); 45 | uMask = ~uMask; 46 | uVal = uVal & uMask; 47 | return uVal; 48 | } 49 | 50 | /* 51 | $ ./a.out 52 | 53 | Enter a value 54 | 56 55 | 56 | Enter bit uPosition (1-16) to set to one 57 | 3 58 | 59 | Value after setting the specified bit = 60 60 | 61 | Enter a value 62 | 63 63 | 64 | Enter bit uPosition (1-16) to mask to zero 65 | 3 66 | 67 | Value after masking the specified bit = 59 68 | */ 69 | -------------------------------------------------------------------------------- /Autonomous/SIT/Sem1/FCP/Programs/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/Autonomous/SIT/Sem1/FCP/Programs/a.out -------------------------------------------------------------------------------- /Autonomous/SIT/Sem1/FCP/Syllabus/FCPLabSyllabus2014-F.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/Autonomous/SIT/Sem1/FCP/Syllabus/FCPLabSyllabus2014-F.pdf -------------------------------------------------------------------------------- /Autonomous/SIT/Sem1/OLD/Lab/A02Calculator.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | int main(void) 4 | { 5 | int iChoice,iVal1,iVal2,iResult; 6 | printf("\nEnter two values\n"); 7 | scanf("%d%d",&iVal1,&iVal2); 8 | 9 | printf("\n1.Addition\n2.Subtraction\n3.Multiplication\n4.Division\n"); 10 | printf("\nEnter your Choice\n"); 11 | scanf("%d",&iChoice); 12 | 13 | switch(iChoice) 14 | { 15 | case 1: iResult = iVal1 + iVal2; 16 | break; 17 | case 2: iResult = iVal1 - iVal2; 18 | break; 19 | case 3: iResult = iVal1 * iVal2; 20 | break; 21 | case 4: if(iVal2 == 0) 22 | { 23 | printf("\nCannot divide by zero\n"); 24 | exit(0); 25 | } 26 | iResult = iVal1 / iVal2; 27 | break; 28 | default: printf("\nInvalid Input\n"); 29 | exit(0); 30 | 31 | } 32 | 33 | printf("\nResult of the operation is : %d\n",iResult); 34 | 35 | return 0; 36 | } 37 | -------------------------------------------------------------------------------- /Autonomous/SIT/Sem1/OLD/Lab/A04RangePrime.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | int i,j, iLim1, iLim2, iFactCnt; 7 | 8 | printf("\nEnter the range\n"); 9 | scanf("%d%d", &iLim1, &iLim2); 10 | 11 | printf("\nPrime numbers in the range %d to %d is\n",iLim1,iLim2); 12 | for(i=iLim1;i<=iLim2;i++) 13 | { 14 | iFactCnt = 0; 15 | for(j=2;j 2 | #include 3 | 4 | #define PI 3.1416 5 | 6 | int main() 7 | { 8 | float fAngD, fAngR; 9 | float fTerm, fNum, fDen, fVal; 10 | int i,iNum; 11 | 12 | printf("Enter the Angle ....\n"); 13 | scanf("%f",&fAngD); 14 | 15 | printf("Angle = %f\n",fAngD); 16 | 17 | printf("Enter the Number of terms...\n"); 18 | scanf("%d",&iNum); 19 | printf("No of terms = %d\n",iNum); 20 | 21 | fAngR= (fAngD*PI)/180 ; 22 | 23 | fNum=fAngR; 24 | fDen=1.0; 25 | fVal =0.0; 26 | fTerm=fNum/fDen; 27 | for(i=1;i<=iNum;i++) 28 | { 29 | fVal = fVal + fTerm; 30 | fNum = -fNum * fAngR * fAngR ; 31 | fDen = fDen * (2*i) * (2*i+1); 32 | fTerm = fNum/fDen; 33 | } 34 | printf(" Calculated value is :Sin( %f ) = %f\n",fAngD,fVal); 35 | printf("Built In function value is :Sin( %f ) = %f\n", 36 | fAngD, sin(fAngR)); 37 | return 0; 38 | } 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /Autonomous/SIT/Sem1/OLD/Lab/A06Polynomial.c: -------------------------------------------------------------------------------- 1 | # include 2 | # include 3 | int main() 4 | { 5 | int n; 6 | int i,sum=0,j; 7 | int a[10]; 8 | int x; 9 | 10 | printf("Enter the Number of Terms...\n"); 11 | scanf("%d",&n); 12 | printf("N=%d\n",n); 13 | printf("Enter %d Co-Efficients...\n",n); 14 | for(i=0;i 2 | #include 3 | 4 | int main() 5 | { 6 | int iaA[20], iaB[20], iaC[20], i, j=0, k=0, iNum; 7 | 8 | printf("\nEnter the no of elements in the array\n"); 9 | scanf("%d", &iNum); 10 | 11 | printf("\nEnter %d elements\n", iNum); 12 | for(i=0;i 2 | #include 3 | #define TRUE 1 4 | #define FALSE 0 5 | 6 | int main(void) 7 | { 8 | int iaMat[100][100],iRow,iCol,i,j; 9 | int isIdentity; 10 | 11 | printf("\nEnter the order of the matrix\n"); 12 | scanf("%d%d",&iRow,&iCol); 13 | 14 | if(iRow != iCol) 15 | { 16 | printf("\nMatrix should be a Square Matrix\n"); 17 | exit(0); 18 | } 19 | 20 | printf("\nEnter the elements of the matrix\n"); 21 | for(i=0;i 2 | #include 3 | 4 | int main() 5 | { 6 | char acStr1[30],acStr2[30]; 7 | char acStr3[30], acStr4[30]; 8 | int i,iLen; 9 | printf("\nEnter the String\n"); 10 | gets(acStr1); 11 | 12 | for(i=0;acStr1[i] != '\0';i++) 13 | { 14 | acStr2[i] = acStr1[i]; 15 | } 16 | acStr2[i] = '\0'; 17 | 18 | printf("\nCopied String\n"); 19 | puts(acStr2); 20 | 21 | return 0; 22 | } 23 | -------------------------------------------------------------------------------- /Autonomous/SIT/Sem1/OLD/Lab/A11ConvertCase.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | char acStr1[50], acStr2[50], ch; 7 | int i, iLen, VowCount=0, ConsCount=0; 8 | 9 | printf("\nEnter the Sentence]\n"); 10 | gets(acStr1); 11 | 12 | for(i=0;acStr1[i]!='\0';i++) 13 | { 14 | switch(acStr1[i]) 15 | { 16 | case 'a': case 'e': case 'i': case 'o': case 'u': 17 | case 'A': case 'E': case 'I': case 'O': case 'U': 18 | VowCount++; break; 19 | case ' ': case '\t': case '\n': break; 20 | default: ConsCount++; 21 | } 22 | 23 | if(acStr1[i]>=65 && acStr1[i]<=90) 24 | { 25 | acStr2[i] = acStr1[i] + 32; 26 | } 27 | else if(acStr1[i]>=97 && acStr1[i]<=122) 28 | { 29 | acStr2[i] = acStr1[i] - 32; 30 | } 31 | else 32 | { 33 | acStr2[i] = acStr1[i]; 34 | } 35 | } 36 | acStr2[i] = '\0'; 37 | 38 | printf("\nOriginal String\n"); 39 | puts(acStr1); 40 | 41 | printf("\nConverted String\n"); 42 | puts(acStr2); 43 | 44 | printf("\nNumber of Vowels: %d\n", VowCount); 45 | printf("\nNumber of Consonants: %d\n", ConsCount); 46 | 47 | return 0; 48 | } 49 | -------------------------------------------------------------------------------- /Autonomous/SIT/Sem1/OLD/Lab/A12Fibonacci.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int fnFibonacci(int); 5 | int main() 6 | { 7 | int iaFib[100],iNum,i; 8 | printf("\nEnter the no. of terms\n"); 9 | scanf("%d",&iNum); 10 | 11 | for(i=0;i 2 | #include 3 | 4 | int fnFibonacci(int); 5 | 6 | int main() 7 | { 8 | int iTerm, i, iNum; 9 | 10 | printf("Enter the no of terms\n"); 11 | scanf("%d", &iNum); 12 | 13 | printf("\nThe terms in the Fibonacci Sequence:\n%d\t%d\t",0,1); 14 | 15 | for(i=2;i 2 | #include 3 | 4 | void fnSwap(int*, int*); 5 | 6 | int main() 7 | { 8 | int iVal1,iVal2; 9 | printf("\nEnter a pair of Values\n"); 10 | scanf("%d%d",&iVal1, &iVal2); 11 | printf("\nBefore Swapping\n"); 12 | printf("\nValue 1 = %d\nValue 2 = %d",iVal1,iVal2); 13 | 14 | fnSwap(&iVal1,&iVal2); 15 | 16 | printf("\nAfter Swapping\n"); 17 | printf("\nValue 1 = %d\nValue 2 = %d",iVal1,iVal2); 18 | return 0; 19 | } 20 | 21 | void fnSwap(int *x, int *y) 22 | { 23 | int temp; 24 | 25 | temp = *x; 26 | *x = *y; 27 | *y = temp; 28 | } 29 | -------------------------------------------------------------------------------- /Autonomous/SIT/Sem1/OLD/Lab/A14ArrayIdentical.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int fnCheckIdentical(int*, int*, int); 5 | 6 | int main() 7 | { 8 | int iaArr1[50],iaArr2[50], iLen1, iLen2, i, iFlag; 9 | int *iptr1, *iptr2; 10 | 11 | printf("\nEnter the no of elements in the 1st array\n"); 12 | scanf("%d",&iLen1); 13 | 14 | printf("\nEnter the no of elements in the 2nd array\n"); 15 | scanf("%d",&iLen2); 16 | 17 | if(iLen1 != iLen2) 18 | { 19 | printf("\nArrays are not Identical\n"); 20 | exit(0); 21 | } 22 | 23 | printf("\nEnter elements of 1st Array\n"); 24 | for(i = 0; i < iLen1; i++) 25 | scanf("%d",&iaArr1[i]); 26 | 27 | printf("\nEnter elements of 2nd Array\n"); 28 | for(i = 0; i < iLen2; i++) 29 | scanf("%d",&iaArr2[i]); 30 | 31 | iptr1 = iaArr1; 32 | iptr2 = iaArr2; 33 | 34 | iFlag = fnCheckIdentical(iptr1, iptr2, iLen1); 35 | 36 | if(iFlag) 37 | printf("\nArrays are Identical\n"); 38 | else 39 | printf("\nArrays are not Identical\n"); 40 | 41 | return 0; 42 | } 43 | 44 | int fnCheckIdentical(int *p, int *q, int n) 45 | { 46 | int i; 47 | for(i=0; i 2 | # include 3 | #define PI 3.1416 4 | int main() 5 | { 6 | float fAngR,fAngD; 7 | float fTerm,fNum,fDen; 8 | float fVal; 9 | int i; 10 | 11 | printf("\n Cos(angle)\t\tValue\t\tlibFn\n"); 12 | for(fAngD = 0.0;fAngD <= 180.0;fAngD += 10.0) 13 | { 14 | fAngR = (fAngD*PI)/180 ; 15 | fNum = 1.0; 16 | fDen = 1.0; 17 | fVal = 0.0; 18 | fTerm = fNum/fDen; 19 | for(i = 1;i<= 10;i++) 20 | { 21 | fVal = fVal + fTerm; 22 | fNum = -fNum * fAngR * fAngR ; 23 | fDen = fDen * (2*i) *(2*i-1); 24 | fTerm = fNum/fDen; 25 | } 26 | printf("Cos(%03.0f) \t %12f \t %12f\n",fAngD,fVal, 27 | cos(fAngR)); 28 | } 29 | return 0; 30 | } 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /Autonomous/SIT/Sem1/OLD/Lab/B02BinarySearch.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | int iaArr[100],iKey,iNum,i,iLow,iMid,iHigh,iProbe; 7 | printf("\nEnter the number of elements\n"); 8 | scanf("%d",&iNum); 9 | 10 | printf("\nEnter %d elements in ascending order\n", iNum); 11 | for(i=0;i iHigh) 36 | printf("\nElement not found\n"); 37 | 38 | printf("\nTotal number of probes required is %d\n", iProbe); 39 | 40 | return 0; 41 | } 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /Autonomous/SIT/Sem1/OLD/Lab/B06TriangleMatrix.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main(void) 5 | { 6 | int iaMat[100][100],iRow,iCol,i,j; 7 | 8 | printf("\nEnter the order of the matrix\n"); 9 | scanf("%d%d",&iRow,&iCol); 10 | 11 | if(iRow != iCol) 12 | { 13 | printf("\nMatrix should be a Square Matrix\n"); 14 | exit(0); 15 | } 16 | for(i=0;i 2 | #include 3 | #include 4 | 5 | int main(void) 6 | { 7 | int iNum, i, j; 8 | char acNames[100][50], cTemp[50],ch; 9 | 10 | printf("\nEnter no of elements\n"); 11 | scanf("%d",&iNum); 12 | 13 | ch = getchar(); 14 | printf("\nEnter the list of names\n"); 15 | for(i=0;i0) 23 | { 24 | strcpy(cTemp, acNames[j]); 25 | strcpy(acNames[j] , acNames[j+1]); 26 | strcpy(acNames[j+1] , cTemp); 27 | } 28 | } 29 | } 30 | 31 | printf("\nThe Sorted name list is \n"); 32 | 33 | for(i=0;i 2 | #include 3 | #include 4 | 5 | int main() 6 | { 7 | char acText[100], acPattern[10]; 8 | int iCount; 9 | char *pos = NULL, *start = NULL; 10 | printf("\nEnter the text\n"); 11 | gets(acText); 12 | 13 | printf("\nEnter the substring to search for\n"); 14 | gets(acPattern); 15 | 16 | start = acText; 17 | while((pos = strstr(start, acPattern))) 18 | { 19 | 20 | iCount++; 21 | start = pos+1; 22 | } 23 | 24 | printf("\nNo of occurences is %d\n", iCount); 25 | 26 | return 0; 27 | } 28 | 29 | -------------------------------------------------------------------------------- /Autonomous/SIT/Sem1/OLD/Lab/B10fnSelectionSort.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | void fnReadArray(int [], int); 5 | void fnPrintArray(int [], int); 6 | void fnSortArray(int [], int); 7 | 8 | int main(void) 9 | { 10 | int iNum, iaArr[10]; 11 | 12 | printf("\nEnter no of elements\n"); 13 | scanf("%d",&iNum); 14 | 15 | fnReadArray(iaArr, iNum); 16 | 17 | printf("\nInput Array is:\n"); 18 | fnPrintArray(iaArr, iNum); 19 | 20 | fnSortArray(iaArr, iNum); 21 | 22 | printf("\nSorted Array is:\n"); 23 | fnPrintArray(iaArr, iNum); 24 | 25 | return 0; 26 | } 27 | 28 | void fnReadArray(int A[], int n) 29 | { 30 | int i; 31 | printf("\nEnter %d elements into the array\n", n); 32 | for(i=0;i 2 | #include 3 | 4 | int fnSearchChar(char [], char, int); 5 | 6 | int main() 7 | { 8 | char acText[30], ch; 9 | int iLen,iPos; 10 | 11 | 12 | printf("\nEnter the string\n"); 13 | gets(acText); 14 | //getchar(); 15 | printf("\nEnter the character\n"); 16 | scanf("%c", &ch); 17 | 18 | for(iLen=0;acText[iLen]!='\0';iLen++); 19 | 20 | iPos = fnSearchChar(acText, ch, iLen-1); 21 | 22 | if(-1 == iPos) 23 | printf("\nCharacter not found\n"); 24 | else 25 | printf("\nCharacter found at position : %d\n", iPos+1); 26 | 27 | return 0; 28 | } 29 | 30 | int fnSearchChar(char str[], char c, int pos) 31 | { 32 | if(pos<0) 33 | return -1; 34 | else if(str[pos] == c) 35 | return pos; 36 | else 37 | return fnSearchChar(str, c, pos-1); 38 | } 39 | 40 | -------------------------------------------------------------------------------- /Autonomous/SIT/Sem1/OLD/Lab/B13ReverseArray.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | int iaArr[10], iLen, i, iTemp; 7 | int *iptr1, *iptr2; 8 | 9 | 10 | printf("\nEnter the no of elements in the 1st array\n"); 11 | scanf("%d",&iLen); 12 | 13 | iptr1 = iaArr; 14 | iptr2 = (iaArr + iLen-1); 15 | 16 | printf("\nEnter elements of the Array\n"); 17 | for(i = 0; i < iLen; i++) 18 | scanf("%d",(iptr1+i)); 19 | 20 | printf("\nElements of the Array before reversing\n"); 21 | for(i = 0; i < iLen; i++) 22 | printf("%d\t",*(iptr1+i)); 23 | 24 | while(iptr1 < iptr2) 25 | { 26 | iTemp = *iptr1; 27 | *iptr1 = *iptr2; 28 | *iptr2 = iTemp; 29 | iptr1++; 30 | iptr2--; 31 | } 32 | 33 | iptr1 = iaArr; 34 | printf("\nElements of the Array after reversing\n"); 35 | for(i = 0; i < iLen; i++) 36 | printf("%d\t",*(iptr1+i)); 37 | 38 | return 0; 39 | } 40 | 41 | -------------------------------------------------------------------------------- /Autonomous/SIT/Sem1/OLD/Lab/B14MyStrCpy.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | void fnMyStrCpy(char*, char*); 5 | 6 | int main() 7 | { 8 | char acSrc[50],acDest[50]; 9 | 10 | printf("\nEnter the string to be copied\n"); 11 | gets(acSrc); 12 | 13 | fnMyStrCpy(acDest, acSrc); 14 | 15 | printf("\nThe copied string is\n"); 16 | puts(acDest); 17 | 18 | return 0; 19 | } 20 | 21 | void fnMyStrCpy(char *dest, char *src) 22 | { 23 | int i; 24 | for(i=0;*(src+i) != '\0';i++) 25 | { 26 | *(dest+i) = *(src+i); 27 | } 28 | *(dest+i) = '\0'; 29 | 30 | // for(i=0;src[i] != '\0';i++) 31 | // { 32 | // dest[i] = src[i]; 33 | // } 34 | // dest[i] = '\0'; 35 | 36 | } 37 | 38 | -------------------------------------------------------------------------------- /Autonomous/SIT/Sem4/BiCoefficient/BICOEFF.x: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/Autonomous/SIT/Sem4/BiCoefficient/BICOEFF.x -------------------------------------------------------------------------------- /Autonomous/SIT/Sem4/HEAPSORT/HeapPlot.gpl: -------------------------------------------------------------------------------- 1 | # Gnuplot script file for plotting data in file "HeapPlot.dat" 2 | # This file is called HeapPlot.gpl 3 | set terminal png font arial 4 | set title "Time Complexity for Heap Sort" 5 | set autoscale 6 | set xlabel "Size of Input" 7 | set ylabel "Sorting Time (microseconds)" 8 | set grid 9 | set output "HeapPlot.png" 10 | plot "HeapPlot.dat" t 'Heap Sort' with lines 11 | -------------------------------------------------------------------------------- /Autonomous/SIT/Sem4/HEAPSORT/HeapPlot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/Autonomous/SIT/Sem4/HEAPSORT/HeapPlot.png -------------------------------------------------------------------------------- /Autonomous/SIT/Sem4/HEAPSORT/OldHeapPlot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/Autonomous/SIT/Sem4/HEAPSORT/OldHeapPlot.png -------------------------------------------------------------------------------- /Autonomous/SIT/Sem4/INSERTIONSORT/InsertionPlot.gpl: -------------------------------------------------------------------------------- 1 | # Gnuplot script file for plotting data in file "InsertionPlot.dat" 2 | # This file is called InsertionPlot.gpl 3 | set terminal png font arial 4 | set title "Time Complexity for Insertion Sort" 5 | set autoscale 6 | set xlabel "Size of Input" 7 | set ylabel "Sorting Time (microseconds)" 8 | set grid 9 | set output "InsertionPlot.png" 10 | plot "InsertionPlot.dat" t 'Insertion Sort' with lines 11 | -------------------------------------------------------------------------------- /Autonomous/SIT/Sem4/INSERTIONSORT/InsertionPlot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/Autonomous/SIT/Sem4/INSERTIONSORT/InsertionPlot.png -------------------------------------------------------------------------------- /Autonomous/SIT/Sem4/MERGESORT/MergePlot.gpl: -------------------------------------------------------------------------------- 1 | # Gnuplot script file for plotting data in file "MergePlot.dat" 2 | # This file is called MergePlot.gpl 3 | set terminal png font arial 4 | set title "Time Complexity for Merge Sort" 5 | set autoscale 6 | set xlabel "Size of Input" 7 | set ylabel "Sorting Time (microseconds)" 8 | set grid 9 | set output "MergePlot.png" 10 | plot "MergePlot.dat" t 'Merge Sort' with lines 11 | -------------------------------------------------------------------------------- /Autonomous/SIT/Sem4/MERGESORT/MergePlot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/Autonomous/SIT/Sem4/MERGESORT/MergePlot.png -------------------------------------------------------------------------------- /Autonomous/SIT/Sem4/QUICKSORT/.QuickPlot.gpl.swp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/Autonomous/SIT/Sem4/QUICKSORT/.QuickPlot.gpl.swp -------------------------------------------------------------------------------- /Autonomous/SIT/Sem4/QUICKSORT/QuickPlot.gpl: -------------------------------------------------------------------------------- 1 | # Gnuplot script file for plotting data in file "QuickPlot.dat" 2 | # This file is called QuickPlot.gpl 3 | set terminal png font arial 4 | set title "Time Complexity for Quick Sort" 5 | set autoscale 6 | set xlabel "Size of Input" 7 | set ylabel "Sorting Time (microseconds)" 8 | set grid 9 | set output "QuickPlot.png" 10 | plot "QuickPlot.dat" t 'Quick Sort' with lines 11 | -------------------------------------------------------------------------------- /Autonomous/SIT/Sem4/QUICKSORT/QuickPlot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/Autonomous/SIT/Sem4/QUICKSORT/QuickPlot.png -------------------------------------------------------------------------------- /Autonomous/SIT/Sem4/TOPOLOGICALSORT/Topological.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/Autonomous/SIT/Sem4/TOPOLOGICALSORT/Topological.jpg -------------------------------------------------------------------------------- /Autonomous/SIT/Sem4/TOPOLOGICALSORT/Topological.odg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/Autonomous/SIT/Sem4/TOPOLOGICALSORT/Topological.odg -------------------------------------------------------------------------------- /Autonomous/SIT/Sem4/TOPOLOGICALSORT/Warshall1.odg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/Autonomous/SIT/Sem4/TOPOLOGICALSORT/Warshall1.odg -------------------------------------------------------------------------------- /Autonomous/SIT/Sem4/TOPOLOGICALSORT/topo.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/Autonomous/SIT/Sem4/TOPOLOGICALSORT/topo.jpeg -------------------------------------------------------------------------------- /Autonomous/SIT/Sem4/WARSHALL/.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | 4 | const int MAX = 100; 5 | 6 | void WarshallTransitiveClosure(int graph[MAX][MAX], int numVert) 7 | { 8 | int i,j,k; 9 | 10 | for (k=0; k 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | char fname[256]; 8 | 9 | int main() 10 | { 11 | ssize_t n; 12 | char buff[512]; 13 | int readfd, writefd; 14 | 15 | printf("Trying to Connect to Server..\n"); 16 | // Opening fifo channels for communication 17 | writefd = open("fifo1", O_WRONLY, 0); 18 | readfd = open("fifo2", O_RDONLY, 0); 19 | printf("Connected..\n"); 20 | 21 | // Take user input: the filename to display 22 | printf("Enter the filename to request from server: "); 23 | scanf("%s",fname); 24 | 25 | // Send the filename to the server by writing it to fifo1 26 | write(writefd, fname, strlen(fname) + 1); 27 | 28 | // Read response sent by the server by reading from fifo2 29 | printf("Waiting for Server to reply..\n"); 30 | while((n = read(readfd,buff,512))>0) 31 | write(1,buff,n); //Display the response on the screen 32 | 33 | //Closing connections 34 | close(readfd); 35 | close(writefd); 36 | return 0; 37 | } 38 | 39 | -------------------------------------------------------------------------------- /Autonomous/Sem7/Computer Networks Lab/pgm5/server.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | char fname[256]; 8 | 9 | 10 | int main() { 11 | int readfd, writefd, fd; 12 | ssize_t n; 13 | char buff[512]; 14 | 15 | // Create fifo files for communication 16 | if (mkfifo("fifo1", 0666)<0) 17 | printf("Unable to create FIFO files\n"); 18 | if (mkfifo("fifo2", 0666)<0) 19 | printf("Unable to create FIFO files\n"); 20 | 21 | //On seeing the above messages, try 'rm fifo1 fifo2' and run the server again 22 | 23 | printf("Waiting for connection Request..\n"); 24 | // opening fifo files to start communication 25 | readfd = open("fifo1", O_RDONLY, 0); 26 | writefd = open("fifo2", O_WRONLY, 0); 27 | printf("Connection Established..\n"); 28 | 29 | // Read client's request sent via fifo1 30 | read(readfd, fname, 255); 31 | printf("Client has requested file %s\n", fname); 32 | 33 | // Check if the requested file exists 34 | if ((fd = open(fname, O_RDWR)) < 0) { 35 | // If no, send message "File doesnot exist to the client 36 | strcpy(buff, "File does not exist..\n"); 37 | write(writefd, buff, strlen(buff)); 38 | } 39 | else { 40 | // Otherwise, read the data in the file and send it 41 | while((n = read(fd, buff,512)) > 0) 42 | write(writefd, buff, n); 43 | } 44 | close(readfd); 45 | unlink("fifo1"); 46 | close(writefd); 47 | unlink("fifo2"); 48 | } 49 | 50 | -------------------------------------------------------------------------------- /Autonomous/Sem7/Readme.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/Autonomous/Sem7/Readme.txt -------------------------------------------------------------------------------- /Autonomous/Sem7/Web Lab/README.md: -------------------------------------------------------------------------------- 1 | ## Running Perl programs 2 | 3 | ### On Ubuntu Linux (with Apache installed) 4 | 5 | Place all the perl script files in the folder meant for CGI scripts as mentioned in the configuration file in `/etc/apache2/sites-available/default`. Mostly this will be /usr/lib/cgi-bin by default. Follow this [link](http://prometheansacrifice.wordpress.com/2013/12/07/running-perl-cgi-scripts/) for more details. 6 | 7 | Access them on the browser using `http://localhost/cgi-bin/filename.pl` 8 | 9 | Make sure to give `x` access to the `.pl` files 10 | 11 | sudo chomd a+x filename.pl 12 | 13 | Its convenient to login as root to execute these programs. In such cases, `sudo` i unnecessary. 14 | 15 | ### On Fedora Linux as prescribed by the VTU 16 | 17 | Place the perl files in /var/www/cgi-bin. Access them on the browser using `http://localhost/cgi-bin/filename.pl` 18 | 19 | 20 | ## Running HTML and PHP 21 | 22 | ### On Ubuntu 23 | 24 | HTML and PHP files can be placed in `/var/www` itself and can be accessed from the browser as `http://localhost/filename.php` or `http://localhost/filename.html` 25 | 26 | ### On Fedora 27 | 28 | HTML and PHP files are placed in `/var/www/html`. Access them on the browser like Ubuntu. -------------------------------------------------------------------------------- /Autonomous/Sem7/Web Lab/pg1/mystyles.css: -------------------------------------------------------------------------------- 1 | p,table,li 2 | { 3 | font-family: "lucida calligraphy", "comic sans", "sans serif"; 4 | margin-left: 5pt; 5 | } 6 | p { word-spacing: 5px;} 7 | body { background-color:rgb(200,255,205);} 8 | 9 | p, li, td { font-size: 75%;} 10 | td { padding: 0.5cm ;} 11 | th 12 | { 13 | text-align: center; 14 | font-size: 85%; 15 | } 16 | 17 | h1,h2,h3,hr 18 | { 19 | text-align: center; 20 | color: #483d8b; 21 | } 22 | 23 | table 24 | { 25 | border-style: outset; 26 | background: rgb(100,255,255); 27 | } 28 | 29 | li { list-style-type: lower-roman;} 30 | 31 | span 32 | { 33 | text-align: center; 34 | color: white; 35 | background-color: blue; 36 | font-size:29pt; 37 | font-style: italic; 38 | font-weight: bold; 39 | } -------------------------------------------------------------------------------- /Autonomous/Sem7/Web Lab/pg1/p1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | LAB PROGRAM! 5 | 6 | 7 |

Information Science & Engg Dept

8 |

Dr. Ambedkar Institute of Technology

9 | 10 |

This header is blue

11 | 12 |

This paragraph has a left margin of 50 pixels

13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 |
NAMES Email
MR RN nagarajar_ise_dept@yahoo.com
Mr JPjprakash@yahoo.com
Mr.Shivkumarshivsp@yahoo.com
31 |
32 |
    33 |
  1. M.Shilpa
  2. 34 |
  3. M.Chetana
  4. 35 |
  5. v.vani
  6. 36 |
  7. padmanabh
  8. 37 |
38 |
39 |

40 |
41 | Information Science 42 |
43 | AIT 44 |
Bangalore
45 |

46 | 47 | 48 | -------------------------------------------------------------------------------- /Autonomous/Sem7/Web Lab/pg10/p10.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 |
7 | Name :
8 | Age :
9 | 10 |
11 | 12 | -------------------------------------------------------------------------------- /Autonomous/Sem7/Web Lab/pg10/p10.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | # Write a Perl program to insert name and age information entered by the user into a table 4 | #created using MySQL and to display the current contents of this table. 5 | 6 | 7 | print "Content-Type: text/html","\n\n"; 8 | print "Result of the insert operation "; 9 | use CGI ':standard'; 10 | use DBI; 11 | 12 | 13 | #to connect to data base interface with database name “vishal”….login ID as “root”..and password as #“ise123”… 14 | $dbh = DBI->connect("DBI:mysql:pppl","jeffrey","mypass"); 15 | $name = param("name"); #to store value from HTML page text box “name” 16 | $age = param("age"); #to store age from HTML page into a variable 17 | $qh = $dbh->prepare("insert into student values('$name','$age')"); # to insert the value into the table #created in the datbase 18 | $qh->execute() or print "error"; #interact with the data base and execute the query following it. 19 | $qh2 = $dbh->prepare("select * from student"); #to retrieve all data from table name “stud” $qh->execute(); 20 | $qh2->execute(); 21 | print ""; 22 | while (($name, $age) = $qh2->fetchrow_array()) #to display data retrieve from database to the HTML page 23 | { 24 | print ""; 25 | } 26 | print "
NameAge
$name$age
"; 27 | $qh->finish(); #To inform that operation is finished 28 | $dbh->disconnect(); #close the connection to the database print""; 29 | -------------------------------------------------------------------------------- /Autonomous/Sem7/Web Lab/pg11/p11.php: -------------------------------------------------------------------------------- 1 | 3 | Hello! Last visted date: " . $cookieData . "
"; 34 | ?> 35 | -------------------------------------------------------------------------------- /Autonomous/Sem7/Web Lab/pg12/p12.php: -------------------------------------------------------------------------------- 1 | the counter is now $_SESSION[count]

" . "

reload this page to increment

"; 15 | // dot in php is the concatenation operator 16 | ?> 17 | -------------------------------------------------------------------------------- /Autonomous/Sem7/Web Lab/pg13/13.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | Name
5 | Address 1
6 | Address 2
7 | Email
8 | 9 |
10 | 11 | -------------------------------------------------------------------------------- /Autonomous/Sem7/Web Lab/pg13/13.php: -------------------------------------------------------------------------------- 1 | "; 21 | echo "NameAddress 1Address 2Email"; 22 | $num = mysql_num_rows($result); 23 | for ($i = 0; $i < $num; $i++) { 24 | // Obtaining data field by field for each column using for loop 25 | $n = mysql_result($result, $i, 'name'); 26 | $a1 = mysql_result($result, $i, 'add1'); 27 | $a2 = mysql_result($result, $i, 'add2'); 28 | $e = mysql_result($result, $i, 'email'); 29 | 30 | // Displaying as a table row 31 | echo "" . $n . "" . $a1 . "" . $a2 . "" . $e . ""; 32 | 33 | /* Alternatively */ 34 | // $arr = mysql_fetch_row($result); 35 | // echo "" . $arr[0] . "" . $arr[1] . "" . $arr[2] . "" . $arr[3] . ""; 36 | } 37 | echo ""; 38 | ?> 39 | -------------------------------------------------------------------------------- /Autonomous/Sem7/Web Lab/pg13/13b.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | Name
5 | 6 |
7 | 8 | -------------------------------------------------------------------------------- /Autonomous/Sem7/Web Lab/pg13/13b.php: -------------------------------------------------------------------------------- 1 | "; 15 | echo "NameAddress 1Address 2Email"; 16 | $num = mysql_num_rows($result); 17 | for ($i = 0; $i < $num; $i++) { 18 | // Obtaining data field by field for each column using for loop 19 | $n = mysql_result($result, $i, 'name'); 20 | $a1 = mysql_result($result, $i, 'add1'); 21 | $a2 = mysql_result($result, $i, 'add2'); 22 | $e = mysql_result($result, $i, 'email'); 23 | 24 | // Displaying as a table row 25 | echo "" . $n . "" . $a1 . "" . $a2 . "" . $e . ""; 26 | 27 | /* Alternatively */ 28 | // $arr = mysql_fetch_row($result); 29 | // echo "" . $arr[0] . "" . $arr[1] . "" . $arr[2] . "" . $arr[3] . ""; 30 | } 31 | echo ""; 32 | ?> 33 | -------------------------------------------------------------------------------- /Autonomous/Sem7/Web Lab/pg13/commands.bash: -------------------------------------------------------------------------------- 1 | # Dont' run this file as a bash script. Use it for command reference 2 | 3 | /etc/init.d/mysqld start #if mysql isn't running 4 | mysql -u root #if theres no password required to login 5 | mysql -u root -p password #otherwise 6 | 7 | # If mysql isn't on the PATH i.e. on running mysql you get 'command not found' error, do the following 8 | cd /var/lib/mysql -------------------------------------------------------------------------------- /Autonomous/Sem7/Web Lab/pg13/p13mysql.sql: -------------------------------------------------------------------------------- 1 | create database php13; 2 | 3 | use php13; 4 | 5 | create table stu(name varchar(100), add1 varchar(100), add2 varchar(100), email varchar(20)); 6 | 7 | #insert some values if required 8 | insert into stu values('John Doe', 'someplace', 'anywhere', 'someid@email.com'); -------------------------------------------------------------------------------- /Autonomous/Sem7/Web Lab/pg14/14.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | Accession No.
5 | Title
6 | Authors
7 | Editor
8 | Publisher
9 | 10 |
11 | 12 | -------------------------------------------------------------------------------- /Autonomous/Sem7/Web Lab/pg14/14b.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | Name
5 | 6 |
7 | 8 | -------------------------------------------------------------------------------- /Autonomous/Sem7/Web Lab/pg14/14b.php: -------------------------------------------------------------------------------- 1 | "; 22 | echo "NameAddress 1Address 2Email"; 23 | for($i = 0; $i < $num; ++$i){ 24 | $a = mysql_fetch_row($res); 25 | echo "" . $a[0] . "" . $a[1] . "" . $a[2] . "" . $a[3] . ""; 26 | } 27 | echo ""; -------------------------------------------------------------------------------- /Autonomous/Sem7/Web Lab/pg14/commands.bash: -------------------------------------------------------------------------------- 1 | # Dont' run this file as a bash script. Use it for command reference 2 | 3 | /etc/init.d/mysqld start #if mysql isn't running 4 | mysql -u root #if theres no password required to login 5 | mysql -u root -p password #otherwise 6 | 7 | # If mysql isn't on the PATH i.e. on running mysql you get 'command not found' error, do the following 8 | cd /var/lib/mysql -------------------------------------------------------------------------------- /Autonomous/Sem7/Web Lab/pg14/p14b.php: -------------------------------------------------------------------------------- 1 | "; 15 | echo "Accession NumberTitleAuthorEditorPublisher"; 16 | $num = mysql_num_rows($result); 17 | for ($i = 0; $i < $num; $i++) { 18 | 19 | // Obtaining data field by field for each column using for loop 20 | $acs = mysql_result($result, $i, 'acs'); 21 | $t = mysql_result($result, $i, 'title'); 22 | $a = mysql_result($result, $i, 'author'); 23 | $e = mysql_result($result, $i, 'edi'); 24 | $p = mysql_result($result, $i, 'pub'); 25 | 26 | // Displaying as a table row 27 | echo "" . $acs . "" . $t . "" . $a . "" . $e . "" . $p . ""; 28 | 29 | /* Alternatively */ 30 | // $arr = mysql_fetch_row($result); 31 | // echo "" . $arr[0] . "" . $arr[1] . "" . $arr[2] . "" . $arr[3] . ""; 32 | } 33 | echo ""; 34 | ?> 35 | -------------------------------------------------------------------------------- /Autonomous/Sem7/Web Lab/pg14/p14mysql.sql: -------------------------------------------------------------------------------- 1 | create database php14; 2 | 3 | use php14; 4 | 5 | create table bkinfo (acs varchar(10), title varchar(50), author varchar(50), edi varchar(50), pub varchar(50)); 6 | 7 | insert into bkinfo values ('1', 'abcd', 'efgh', 'ijkl', 'mnop'); -------------------------------------------------------------------------------- /Autonomous/Sem7/Web Lab/pg2/p2a.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 30 | 31 | -------------------------------------------------------------------------------- /Autonomous/Sem7/Web Lab/pg2/p2b.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Program 2b 4 | 5 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /Autonomous/Sem7/Web Lab/pg3/p3a.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 43 | 44 | 45 |
46 | Enter a string 47 | 48 |
49 | 50 | -------------------------------------------------------------------------------- /Autonomous/Sem7/Web Lab/pg3/p3b.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 20 | 21 | 22 |
23 | Enter the number 24 | 25 |
26 | 27 | -------------------------------------------------------------------------------- /Autonomous/Sem7/Web Lab/pg4/p4a.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 30 | 31 | 32 |
33 | Enter the USN 34 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /Autonomous/Sem7/Web Lab/pg4/p4b.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 53 | 54 | 55 |
56 | Enter the USN
Enter semester
57 | 58 |
59 | 60 | -------------------------------------------------------------------------------- /Autonomous/Sem7/Web Lab/pg6/p6a.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 1DA10IS031 6 | Jane Doe 7 | 21 8 | 9 | 10 | 1DA10IS041 11 | John Doe 12 | 22 13 | 14 | 15 | 1DA10IS034 16 | Jeery Doe 17 | 21 18 | 19 | -------------------------------------------------------------------------------- /Autonomous/Sem7/Web Lab/pg6/p6a.xsl: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 |

Students

8 | 9 | USN
10 | 11 | 12 | Name
13 | 14 | 15 | AGE
16 | 17 |
18 |
19 |
-------------------------------------------------------------------------------- /Autonomous/Sem7/Web Lab/pg6/p6b.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 1BI07IS402 7 | Keerthi Kumar 8 | AIT 9 | ISE 10 | 2006 11 | keerthikumar@yahoo.co.in 12 | -------------------------------------------------------------------------------- /Autonomous/Sem7/Web Lab/pg6/p6b.xsl: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | STYLE SHEET FOR 6b.xml 11 | 12 | 13 |

VTU STUDENT'S DESCRIPTIONS

14 | 15 | USN: 16 |
17 | 18 | NAME: 19 |
20 | 21 | COLLEGE: 22 |
23 | 24 | BRANCH: 25 |
26 | 27 | YEAR OF JOINING: 28 |
29 | 30 | E-MAIL: 31 |

32 | 33 | 34 | 35 | 36 | 37 |
38 | 39 |
-------------------------------------------------------------------------------- /Autonomous/Sem7/Web Lab/pg7/p07a.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | ################################################################ 4 | # Server configuration is always stored in the $ENV variable 5 | # In this program, we simpy access the required info from $ENV 6 | ################################################################ 7 | 8 | use CGI ':standard'; 9 | print "Content-type: text/html","\n\n"; 10 | print "\n"; 11 | print "About this Server\n"; 12 | print "

About this server

","\n"; 13 | print"
"; 14 | print "Server name :",$ENV{'SERVER_NAME'},"
"; 15 | print "Running on port :",$ENV{'SERVER_PORT'},"
"; 16 | print "Server software :",$ENV{'SERVER_SOFTWARE'},"
"; 17 | print "CGI-Revision :",$ENV{'GATEWAY_INTERFACE'},"
"; 18 | print "
\n"; 19 | print "\n"; 20 | -------------------------------------------------------------------------------- /Autonomous/Sem7/Web Lab/pg7/p07b.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 |
7 | 8 | -------------------------------------------------------------------------------- /Autonomous/Sem7/Web Lab/pg7/p07b.pl: -------------------------------------------------------------------------------- 1 | #! /usr/bin/perl 2 | 3 | use CGI ':standard'; 4 | print "Content-type: text/html \n\n"; 5 | $c = param('com'); 6 | system($c); 7 | -------------------------------------------------------------------------------- /Autonomous/Sem7/Web Lab/pg8/count.txt: -------------------------------------------------------------------------------- 1 | 10 -------------------------------------------------------------------------------- /Autonomous/Sem7/Web Lab/pg8/p08a.pl: -------------------------------------------------------------------------------- 1 | #! /usr/bin/perl 2 | 3 | use CGI ':standard'; 4 | use CGI::Carp qw(warningsToBrowser); 5 | 6 | 7 | ###################################################################### 8 | # This program requires count.txt to be created before it. 9 | # So create count.txt using gedit or any text editor and initialise 10 | # it with zero 11 | # After that give write permissions to all users. Else only the program 12 | # itself will be able write into the file, not the browser 13 | # 14 | # Command: 15 | # chmod a+w count.txt 16 | ###################################################################### 17 | 18 | 19 | print header(); 20 | 21 | #Set the Title for the title bar and background color and text colour. 22 | print start_html(-title=>"webpage counter",-bgcolor=>"black",-text=>"red"); 23 | 24 | #Open count.txt used to store the view count 25 | open(FILE,'; 29 | 30 | #close the file as no more reading is left 31 | close(FILE); 32 | 33 | #increment the count whenever the page(file)is opened and closed. 34 | $count++; 35 | 36 | #open the file for writing 37 | open(FILE,'>count.txt'); 38 | 39 | #write $count into the file 40 | print FILE "$count"; 41 | 42 | #close the file 43 | close(FILE); 44 | 45 | #Display $count on the browser 46 | print b("this page has been viewed $count times"); 47 | 48 | #Close html 49 | print end_html(); -------------------------------------------------------------------------------- /Autonomous/Sem7/Web Lab/pg9/p09.pl: -------------------------------------------------------------------------------- 1 | #! /usr/bin/perl 2 | use CGI ':standard'; 3 | 4 | print "Content-Type: text/html\n\n"; 5 | print start_html(-title => "Program 9", -bgcolor => "Black", -text => "White"); #sets the title and background color 6 | ($s,$m,$h) = localtime(); #to get the current time 7 | print br,br,"The current system time is $h:$m:$s"; #equivalent to

of xhtml and print the time. 8 | print br,br,hr,"In words $h hours $m minutes $s seconds"; 9 | print end_html(); #ends the HTML document by printing the and tags. -------------------------------------------------------------------------------- /Autonomous/Sem8/Readme.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/Autonomous/Sem8/Readme.txt -------------------------------------------------------------------------------- /Autonomous/Sem8/Syllabus.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/Autonomous/Sem8/Syllabus.md -------------------------------------------------------------------------------- /VTU/Sem1_Sem2/CPL2014/14cpl16.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem1_Sem2/CPL2014/14cpl16.pdf -------------------------------------------------------------------------------- /VTU/Sem1_Sem2/CPL2014/CPL0.5.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem1_Sem2/CPL2014/CPL0.5.pdf -------------------------------------------------------------------------------- /VTU/Sem1_Sem2/CPL2014/Latex/cc-by-sa.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem1_Sem2/CPL2014/Latex/cc-by-sa.png -------------------------------------------------------------------------------- /VTU/Sem1_Sem2/CPL2014/Latex/fsmk_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem1_Sem2/CPL2014/Latex/fsmk_logo.png -------------------------------------------------------------------------------- /VTU/Sem1_Sem2/CPL2014/Latex/gnu-gcc-cb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem1_Sem2/CPL2014/Latex/gnu-gcc-cb.png -------------------------------------------------------------------------------- /VTU/Sem1_Sem2/CPL2014/Latex/i-gnu-c3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem1_Sem2/CPL2014/Latex/i-gnu-c3.png -------------------------------------------------------------------------------- /VTU/Sem1_Sem2/CPL2014/Programs/ Updated Lab Set/03aSquareRoot.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int main() 6 | { 7 | float fVal, fNextGuess, fLastGuess = 1.0f, fDiff ; 8 | printf("\nEnter a value whose square root has to be calculated\n"); 9 | scanf("%f", &fVal); 10 | do 11 | { 12 | fNextGuess = 0.5 * (fLastGuess + (fVal/fLastGuess)); 13 | fDiff = fabs(fNextGuess - fLastGuess); 14 | fLastGuess = fNextGuess; 15 | }while (fDiff > 0.0001); 16 | 17 | printf("\nSquare root of %g = %g\n", fVal, fNextGuess); 18 | return 0; 19 | } 20 | 21 | -------------------------------------------------------------------------------- /VTU/Sem1_Sem2/CPL2014/Programs/ Updated Lab Set/03bCheckLeapYear.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | int iYear; 7 | 8 | printf("\n Enter a year\n"); 9 | scanf("%d", &iYear); 10 | 11 | if(iYear % 4 == 0 && iYear % 100 != 0) 12 | printf("\n%d is a leap year\n",iYear); 13 | else if(iYear % 400 == 0) 14 | printf("\n%d is a leap year\n",iYear); 15 | else 16 | printf("\n%d is not a leap year\n",iYear); 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /VTU/Sem1_Sem2/CPL2014/Programs/ Updated Lab Set/04Horner.c: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | *File : 04Horner.c 3 | *Description : Program to implement Horners method for Polynomial evaluation 4 | *Author : Prabodh C P 5 | *Compiler : gcc compiler, Ubuntu 8.10 6 | *Date : 7 September 2010 7 | ***************************************************************************/ 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | /*************************************************************************** 14 | *Function : main 15 | *Input parameters: none 16 | *RETURNS : 0 on success 17 | ***************************************************************************/ 18 | 19 | int main(void) 20 | { 21 | 22 | int iDeg,i,iaCoeff[10]; 23 | float fX,fSum=0; 24 | 25 | printf("\n*********************************************************************"); 26 | printf("\n*\tPROGRAM TO EVALUATE A POLYNOMIAL USING HORNERS METHOD\t *\n"); 27 | printf("*********************************************************************"); 28 | 29 | printf("\nEnter the degree of the polynomial and value of x\n"); 30 | scanf("%d%f",&iDeg,&fX); 31 | 32 | printf("\nEnter the coefficients \n"); 33 | for(i=0;i<=iDeg;i++) 34 | { 35 | scanf("%d",&iaCoeff[i]); 36 | } 37 | 38 | for(i=0;i 2 | #include 3 | 4 | #define PI 3.1416 5 | 6 | int main() 7 | { 8 | float fAngD, fAngR; 9 | float fTerm, fNum, fDen, fVal; 10 | int i,iNum; 11 | 12 | printf("Enter the Angle ....\n"); 13 | scanf("%f",&fAngD); 14 | 15 | printf("Angle = %f\n",fAngD); 16 | 17 | printf("Enter the Number of terms...\n"); 18 | scanf("%d",&iNum); 19 | printf("No of terms = %d\n",iNum); 20 | 21 | fAngR= (fAngD*PI)/180 ; 22 | 23 | fNum=fAngR; 24 | fDen=1.0; 25 | fVal =0.0; 26 | fTerm=fNum/fDen; 27 | for(i=1;i<=iNum;i++) 28 | { 29 | fVal = fVal + fTerm; 30 | fNum = -fNum * fAngR * fAngR ; 31 | fDen = fDen * (2*i) * (2*i+1); 32 | fTerm = fNum/fDen; 33 | } 34 | printf(" Calculated value is :Sin( %f ) = %f\n",fAngD,fVal); 35 | printf("Built In function value is :Sin( %f ) = %f\n", 36 | fAngD, sin(fAngR)); 37 | return 0; 38 | } 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /VTU/Sem1_Sem2/CPL2014/Programs/ Updated Lab Set/10BisPrimefn.c: -------------------------------------------------------------------------------- 1 | /*pg 28 and 293 in second 183*/ 2 | #include 3 | #include 4 | 5 | int fnCheckPrime(int); 6 | 7 | int main(void) 8 | { 9 | int iVal1, iVal2, i; 10 | 11 | printf("\nEnter the range\n"); 12 | scanf("%d%d",&iVal1, &iVal2); 13 | 14 | printf("\nPrime numbers in the range %d to %d is\n", iVal1, iVal2); 15 | for(i=iVal1;i<=iVal2;i++) 16 | { 17 | if(fnCheckPrime(i)) //arguments 18 | printf("%d\t", i); 19 | } 20 | 21 | return 0; 22 | } 23 | 24 | /*Function with return values and parameters*/ 25 | 26 | int fnCheckPrime(int iX) //parameters 27 | { 28 | int i,isPrime = 1; 29 | for(i=2;i 2 | #include 3 | 4 | int fnFactorial(int); 5 | 6 | int main() 7 | { 8 | int iN,iR,iNCR; 9 | printf("\nEnter the value of n\n"); 10 | scanf("%d", &iN); 11 | printf("\nEnter the value of r\n"); 12 | scanf("%d", &iR); 13 | 14 | if(iN < iR) 15 | { 16 | printf("\nnCr does not exist\n"); 17 | exit(0); 18 | } 19 | 20 | iNCR = (fnFactorial(iN)/(fnFactorial(iR)*fnFactorial(iN-iR))); 21 | 22 | printf("\nFor n = %d and r = %d, %dC%d = %d\n", iN ,iR, iN, iR, iNCR); 23 | return 0; 24 | } 25 | 26 | int fnFactorial(int iVal) 27 | { 28 | if(0 == iVal) 29 | return 1; 30 | else 31 | return (iVal * fnFactorial(iVal - 1)); 32 | } 33 | -------------------------------------------------------------------------------- /VTU/Sem1_Sem2/CPL2014/Programs/ Updated Lab Set/12File.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | FILE *fp1, *fp2, *fp3; 7 | char studName[30], studUsn[10]; 8 | 9 | 10 | fp1 = fopen("studentname.txt", "r"); 11 | fp2 = fopen("usn.txt", "r"); 12 | fp3 = fopen("output.txt", "w"); 13 | 14 | fprintf(fp3,"%20s\t%20s\n","StudentName","USN"); 15 | // while(fgets(studName, 30, fp1)!=EOF && fscanf(fp2,"%s",studUsn)!=EOF) 16 | while(fscanf(fp1,"%s",studName)!=EOF && fscanf(fp2,"%s",studUsn)!=EOF) 17 | { 18 | fprintf(fp3,"%20s\t%20s\n",studName,studUsn); 19 | } 20 | fclose(fp3); 21 | fp3 = fopen("output.txt", "r"); 22 | 23 | while(fscanf(fp3,"%s%s",studName,studUsn)!=EOF) 24 | { 25 | printf("%20s\t%20s\n",studName,studUsn); 26 | } 27 | 28 | fclose(fp1); 29 | fclose(fp2); 30 | fclose(fp3); 31 | return 0; 32 | } 33 | 34 | -------------------------------------------------------------------------------- /VTU/Sem1_Sem2/CPL2014/Programs/ Updated Lab Set/13StudMarks.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | typedef struct 5 | { 6 | int iRollNo; 7 | char acName[30]; 8 | int iMarks; 9 | char cGrade; 10 | }STUDENT; 11 | 12 | int main() 13 | { 14 | STUDENT s[20]; 15 | int i, iNum, iFound = 0; 16 | char acStudName[30]; 17 | 18 | printf("\nEnter the number of students\n"); 19 | scanf("%d", &iNum); 20 | getchar(); 21 | 22 | printf("\nEnter Student Details\n"); 23 | for(i=0;i 2 | #include 3 | #include 4 | 5 | int main() 6 | { 7 | int iNum, i, j; 8 | double daArr[50], dTemp; 9 | double *dPtr; 10 | 11 | double dSum,dMean,dVar,dStdDev; 12 | 13 | dPtr = daArr; 14 | 15 | printf("\nEnter the no of elements in the array\n"); 16 | scanf("%d",&iNum); 17 | 18 | printf("\nEnter elements of Array\n"); 19 | for(i = 0; i < iNum; i++) 20 | scanf("%lf",dPtr+i); 21 | 22 | printf("\nThe elements of Array\n"); 23 | for(i = 0; i < iNum; i++) 24 | printf("%0.2lf \t",*(dPtr+i)); 25 | printf("\n\n"); 26 | 27 | for(i = 0; i < iNum; i++) 28 | dSum += *(dPtr+i); 29 | 30 | dMean = dSum/iNum; 31 | 32 | 33 | for(i = 0; i < iNum; i++) 34 | { 35 | dVar += ((*(dPtr+i)-dMean)*(*(dPtr+i)-dMean)); 36 | } 37 | dVar = dVar/iNum; 38 | 39 | dStdDev = sqrt(dVar); 40 | 41 | printf("\nMean = %g\n", dMean); 42 | printf("\nVariance = %g\n", dVar); 43 | printf("\nStd Deviation = %g\n", dStdDev); 44 | 45 | return 0; 46 | } 47 | 48 | -------------------------------------------------------------------------------- /VTU/Sem1_Sem2/CPL2014/Programs/ Updated Lab Set/studentname.txt: -------------------------------------------------------------------------------- 1 | Raju 2 | Rani 3 | Sid 4 | Ali 5 | Mary 6 | -------------------------------------------------------------------------------- /VTU/Sem1_Sem2/CPL2014/Programs/ Updated Lab Set/usn.txt: -------------------------------------------------------------------------------- 1 | 1CR14CS037 2 | 1KT13CS067 3 | 1PE14IS098 4 | 4NI14CS068 5 | 1SI14CS112 6 | -------------------------------------------------------------------------------- /VTU/Sem1_Sem2/CPL2014/Programs/Older Programs/12FileAppend.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | FILE *fp1,*fp2, *fp3; 7 | int iWordCount = 0, iLineCount = 0; 8 | char cCharacter; 9 | 10 | fp1 = fopen("Ramayana.in","r"); 11 | fp2 = fopen("Mahabharatha.in", "r"); 12 | fp3 = fopen("Karnataka.in", "w+"); 13 | 14 | while((cCharacter=fgetc(fp1))!=EOF) 15 | { 16 | fputc(cCharacter,fp3); 17 | } 18 | 19 | while((cCharacter=fgetc(fp2))!=EOF) 20 | { 21 | fputc(cCharacter,fp3); 22 | } 23 | 24 | rewind(fp3); 25 | 26 | while((cCharacter=fgetc(fp3))!=EOF) 27 | { 28 | if(cCharacter == '\n') 29 | { 30 | iLineCount++; 31 | iWordCount++; 32 | } 33 | else if(cCharacter == '\t' || cCharacter == ' ') 34 | iWordCount++; 35 | printf("%c",cCharacter); 36 | } 37 | fclose(fp1); 38 | fclose(fp2); 39 | fclose(fp3); 40 | 41 | printf("\n\nNumber of lines is : %d\n", iLineCount); 42 | 43 | printf("\n\nNumber of words is : %d\n", iWordCount); 44 | 45 | //Code for Verification (works only on GNU\Linux) 46 | printf("\nOutput of command : wc Karnataka.in -lw\n"); 47 | system("wc Karnataka.in -lw"); 48 | return 0; 49 | } 50 | 51 | -------------------------------------------------------------------------------- /VTU/Sem1_Sem2/CPL2014/Programs/Older Programs/14MeanStd.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int main() 6 | { 7 | int iNum, i, j; 8 | double daArr[50], dTemp; 9 | double *dPtr; 10 | 11 | double dSum,dMean,dVar,dStdDev; 12 | 13 | dPtr = daArr; 14 | 15 | printf("\nEnter the no of elements in the array\n"); 16 | scanf("%d",&iNum); 17 | 18 | printf("\nEnter elements of Array\n"); 19 | for(i = 0; i < iNum; i++) 20 | scanf("%lf",dPtr+i); 21 | 22 | printf("\nThe elements of Array\n"); 23 | for(i = 0; i < iNum; i++) 24 | printf("%0.2lf \t",*(dPtr+i)); 25 | printf("\n\n"); 26 | 27 | for(i = 0; i < iNum; i++) 28 | dSum += *(dPtr+i); 29 | 30 | dMean = dSum/iNum; 31 | 32 | 33 | for(i = 0; i < iNum; i++) 34 | { 35 | dVar += ((*(dPtr+i)-dMean)*(*(dPtr+i)-dMean)); 36 | } 37 | dVar = dVar/iNum; 38 | 39 | dStdDev = sqrt(dVar); 40 | 41 | printf("\nMean = %g\n", dMean); 42 | printf("\nVariance = %g\n", dVar); 43 | printf("\nStd Deviation = %g\n", dStdDev); 44 | 45 | return 0; 46 | } 47 | 48 | -------------------------------------------------------------------------------- /VTU/Sem1_Sem2/CPL2014/Programs/Older Programs/14aPointerArrSum.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(void) 4 | { 5 | int iaArr[100],iNum,i,iTotal; 6 | int *iPtr; 7 | 8 | iPtr = iaArr; 9 | printf("\nEnter the number of elements\n"); 10 | scanf("%d",&iNum); 11 | 12 | printf("\nEnter the elements\n"); 13 | for(i=0;i 2 | #include 3 | 4 | int main() 5 | { 6 | int *iPtr, iNum, i, iSum=0; 7 | 8 | printf("\nEnter number of elements : "); 9 | scanf("%d", &iNum); 10 | 11 | iPtr = (int*)malloc(iNum * sizeof(int)); 12 | 13 | for(i=0;i 2 | #include 3 | 4 | int main() 5 | { 6 | int iNum, i, j; 7 | float faArr1[50], fTemp; 8 | float *fPtr; 9 | 10 | float fMedian; 11 | 12 | fPtr = faArr1; 13 | 14 | printf("\nEnter the no of elements in the array\n"); 15 | scanf("%d",&iNum); 16 | 17 | printf("\nEnter elements of Array\n"); 18 | for(i = 0; i < iNum; i++) 19 | scanf("%f",fPtr+i); 20 | 21 | printf("\nThe elements of Array\n"); 22 | for(i = 0; i < iNum; i++) 23 | printf("%0.2f \t",*(fPtr+i)); 24 | 25 | for(i = 0; i < iNum-1; i++) 26 | { 27 | for(j = i+1; j < iNum; j++) 28 | { 29 | if(faArr1[i] > faArr1[j]) 30 | { 31 | fTemp = faArr1[i]; 32 | faArr1[i] = faArr1[j]; 33 | faArr1[j] = fTemp; 34 | } 35 | } 36 | 37 | } 38 | 39 | if(iNum%2) 40 | fMedian = *(fPtr+(iNum/2)); 41 | else 42 | fMedian = (*(fPtr+(iNum/2)) + *(fPtr+(iNum/2)-1))/2.0f; 43 | 44 | 45 | printf("\nMedian = %g\n", fMedian); 46 | 47 | return 0; 48 | } 49 | 50 | -------------------------------------------------------------------------------- /VTU/Sem1_Sem2/CPL2014/Programs/Revised Lab Set/03aSquareRoot.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int main() 6 | { 7 | float fVal, fNextGuess, fLastGuess = 1.0f, fDiff ; 8 | printf("\nEnter a value whose square root has to be calculated\n"); 9 | scanf("%f", &fVal); 10 | do 11 | { 12 | fNextGuess = 0.5 * (fLastGuess + (fVal/fLastGuess)); 13 | fDiff = fabs(fNextGuess - fLastGuess); 14 | fLastGuess = fNextGuess; 15 | }while (fDiff > 0.0001); 16 | 17 | printf("\nSquare root of %g = %g\n", fVal, fNextGuess); 18 | return 0; 19 | } 20 | 21 | -------------------------------------------------------------------------------- /VTU/Sem1_Sem2/CPL2014/Programs/Revised Lab Set/03bCheckLeapYear.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | int iYear; 7 | 8 | printf("\n Enter a year\n"); 9 | scanf("%d", &iYear); 10 | 11 | if(iYear % 4 == 0 && iYear % 100 != 0) 12 | printf("\n%d is a leap year\n",iYear); 13 | else if(iYear % 400 == 0) 14 | printf("\n%d is a leap year\n",iYear); 15 | else 16 | printf("\n%d is not a leap year\n",iYear); 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /VTU/Sem1_Sem2/CPL2014/Programs/Revised Lab Set/04Horner.c: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | *File : 04Horner.c 3 | *Description : Program to implement Horners method for Polynomial evaluation 4 | *Author : Prabodh C P 5 | *Compiler : gcc compiler, Ubuntu 8.10 6 | *Date : 7 September 2010 7 | ***************************************************************************/ 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | /*************************************************************************** 14 | *Function : main 15 | *Input parameters: none 16 | *RETURNS : 0 on success 17 | ***************************************************************************/ 18 | 19 | int main(void) 20 | { 21 | 22 | int iDeg,i,iaCoeff[10]; 23 | float fX,fSum=0; 24 | 25 | printf("\n*********************************************************************"); 26 | printf("\n*\tPROGRAM TO EVALUATE A POLYNOMIAL USING HORNERS METHOD\t *\n"); 27 | printf("*********************************************************************"); 28 | 29 | printf("\nEnter the degree of the polynomial and value of x\n"); 30 | scanf("%d%f",&iDeg,&fX); 31 | 32 | printf("\nEnter the coefficients \n"); 33 | for(i=0;i<=iDeg;i++) 34 | { 35 | scanf("%d",&iaCoeff[i]); 36 | } 37 | 38 | for(i=0;i 2 | #include 3 | 4 | #define PI 3.1416 5 | 6 | int main() 7 | { 8 | float fAngD, fAngR; 9 | float fTerm, fNum, fDen, fVal; 10 | int i,iNum; 11 | 12 | printf("Enter the Angle ....\n"); 13 | scanf("%f",&fAngD); 14 | 15 | printf("Angle = %f\n",fAngD); 16 | 17 | printf("Enter the Number of terms...\n"); 18 | scanf("%d",&iNum); 19 | printf("No of terms = %d\n",iNum); 20 | 21 | fAngR= (fAngD*PI)/180 ; 22 | 23 | fNum=fAngR; 24 | fDen=1.0; 25 | fVal =0.0; 26 | fTerm=fNum/fDen; 27 | for(i=1;i<=iNum;i++) 28 | { 29 | fVal = fVal + fTerm; 30 | fNum = -fNum * fAngR * fAngR ; 31 | fDen = fDen * (2*i) * (2*i+1); 32 | fTerm = fNum/fDen; 33 | } 34 | printf(" Calculated value is :Sin( %f ) = %f\n",fAngD,fVal); 35 | printf("Built In function value is :Sin( %f ) = %f\n", 36 | fAngD, sin(fAngR)); 37 | return 0; 38 | } 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /VTU/Sem1_Sem2/CPL2014/Programs/Revised Lab Set/10BisPrimefn.c: -------------------------------------------------------------------------------- 1 | /*pg 28 and 293 in second 183*/ 2 | #include 3 | #include 4 | 5 | int fnCheckPrime(int); 6 | 7 | int main(void) 8 | { 9 | int iVal1, iVal2, i; 10 | 11 | printf("\nEnter the range\n"); 12 | scanf("%d%d",&iVal1, &iVal2); 13 | 14 | printf("\nPrime numbers in the range %d to %d is\n", iVal1, iVal2); 15 | for(i=iVal1;i<=iVal2;i++) 16 | { 17 | if(fnCheckPrime(i)) //arguments 18 | printf("%d\t", i); 19 | } 20 | 21 | return 0; 22 | } 23 | 24 | /*Function with return values and parameters*/ 25 | 26 | int fnCheckPrime(int iX) //parameters 27 | { 28 | int i,isPrime = 1; 29 | for(i=2;i 2 | #include 3 | 4 | int fnFactorial(int); 5 | 6 | int main() 7 | { 8 | int iN,iR,iNCR; 9 | printf("\nEnter the value of n\n"); 10 | scanf("%d", &iN); 11 | printf("\nEnter the value of r\n"); 12 | scanf("%d", &iR); 13 | 14 | if(iN < iR) 15 | { 16 | printf("\nnCr does not exist\n"); 17 | exit(0); 18 | } 19 | 20 | iNCR = (fnFactorial(iN)/(fnFactorial(iR)*fnFactorial(iN-iR))); 21 | 22 | printf("\nFor n = %d and r = %d, %dC%d = %d\n", iN ,iR, iN, iR, iNCR); 23 | return 0; 24 | } 25 | 26 | int fnFactorial(int iVal) 27 | { 28 | if(0 == iVal) 29 | return 1; 30 | else 31 | return (iVal * fnFactorial(iVal - 1)); 32 | } 33 | -------------------------------------------------------------------------------- /VTU/Sem1_Sem2/CPL2014/Programs/Revised Lab Set/12File.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | FILE *fp1, *fp2, *fp3; 7 | char studName[30], studUsn[10]; 8 | 9 | 10 | fp1 = fopen("studentname.txt", "r"); 11 | fp2 = fopen("usn.txt", "r"); 12 | fp3 = fopen("output.txt", "w"); 13 | 14 | fprintf(fp3,"%20s\t%20s\n","StudentName","USN"); 15 | // while(fgets(studName, 30, fp1)!=EOF && fscanf(fp2,"%s",studUsn)!=EOF) 16 | while(fscanf(fp1,"%s",studName)!=EOF && fscanf(fp2,"%s",studUsn)!=EOF) 17 | { 18 | fprintf(fp3,"%20s\t%20s\n",studName,studUsn); 19 | } 20 | fclose(fp3); 21 | fp3 = fopen("output.txt", "r"); 22 | 23 | while(fscanf(fp3,"%s%s",studName,studUsn)!=EOF) 24 | { 25 | printf("%20s\t%20s\n",studName,studUsn); 26 | } 27 | 28 | fclose(fp1); 29 | fclose(fp2); 30 | fclose(fp3); 31 | return 0; 32 | } 33 | 34 | -------------------------------------------------------------------------------- /VTU/Sem1_Sem2/CPL2014/Programs/Revised Lab Set/13StudMarks.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | typedef struct 5 | { 6 | int iRollNo; 7 | char acName[30]; 8 | int iMarks; 9 | char cGrade; 10 | }STUDENT; 11 | 12 | int main() 13 | { 14 | STUDENT s[20]; 15 | int i, iNum, iFound = 0; 16 | char acStudName[30]; 17 | 18 | printf("\nEnter the number of students\n"); 19 | scanf("%d", &iNum); 20 | getchar(); 21 | 22 | printf("\nEnter Student Details\n"); 23 | for(i=0;i 2 | #include 3 | #include 4 | 5 | int main() 6 | { 7 | int iNum, i, j; 8 | double daArr[50], dTemp; 9 | double *dPtr; 10 | 11 | double dSum,dMean,dVar,dStdDev; 12 | 13 | dPtr = daArr; 14 | 15 | printf("\nEnter the no of elements in the array\n"); 16 | scanf("%d",&iNum); 17 | 18 | printf("\nEnter elements of Array\n"); 19 | for(i = 0; i < iNum; i++) 20 | scanf("%lf",dPtr+i); 21 | 22 | printf("\nThe elements of Array\n"); 23 | for(i = 0; i < iNum; i++) 24 | printf("%0.2lf \t",*(dPtr+i)); 25 | printf("\n\n"); 26 | 27 | for(i = 0; i < iNum; i++) 28 | dSum += *(dPtr+i); 29 | 30 | dMean = dSum/iNum; 31 | 32 | 33 | for(i = 0; i < iNum; i++) 34 | { 35 | dVar += ((*(dPtr+i)-dMean)*(*(dPtr+i)-dMean)); 36 | } 37 | dVar = dVar/iNum; 38 | 39 | dStdDev = sqrt(dVar); 40 | 41 | printf("\nMean = %g\n", dMean); 42 | printf("\nVariance = %g\n", dVar); 43 | printf("\nStd Deviation = %g\n", dStdDev); 44 | 45 | return 0; 46 | } 47 | 48 | -------------------------------------------------------------------------------- /VTU/Sem1_Sem2/CPL2014/Programs/Revised Lab Set/studentname.txt: -------------------------------------------------------------------------------- 1 | Raju 2 | Rani 3 | Sid 4 | Ali 5 | Mary 6 | -------------------------------------------------------------------------------- /VTU/Sem1_Sem2/CPL2014/Programs/Revised Lab Set/usn.txt: -------------------------------------------------------------------------------- 1 | 1CR14CS037 2 | 1KT13CS067 3 | 1PE14IS098 4 | 4NI14CS068 5 | 1SI14CS112 6 | -------------------------------------------------------------------------------- /VTU/Sem1_Sem2/CPL2014/SyllabusCPL.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem1_Sem2/CPL2014/SyllabusCPL.pdf -------------------------------------------------------------------------------- /VTU/Sem1_Sem2/OLD2010/CPP_Lab/.old/03Palindrome.c: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | *File : 03Palindrome.c 3 | *Description : Program to check whether the given integer is a Palindrome or not 4 | *Author : Prabodh C P 5 | *Compiler : gcc compiler, Ubuntu 10.04 6 | *Date : 4 July 2012 7 | ***************************************************************************/ 8 | 9 | #include 10 | #include 11 | 12 | /*************************************************************************** 13 | *Function : main 14 | *Input parameters: no parameters 15 | *RETURNS : 0 on success 16 | ***************************************************************************/ 17 | 18 | int main(void) 19 | { 20 | int iNum,iRev = 0,iTemp,iRem; 21 | 22 | printf("\n**************************************************************************"); 23 | printf("\n*\tPROGRAM TO CHECK WHETHER AN INTEGER IS A PALINDROME OR NOT\t *\n"); 24 | printf("**************************************************************************"); 25 | 26 | printf("\nEnter a number\n"); 27 | scanf("%d",&iNum); 28 | 29 | iTemp = iNum; 30 | 31 | while(iNum!=0) 32 | { 33 | iRem = iNum % 10; 34 | iRev = iRev * 10 + iRem; 35 | iNum = iNum/10; 36 | } 37 | printf("\nReverse is %d",iRev); 38 | 39 | if(iRev == iTemp) 40 | printf("\nNumber %d is a palindrome\n",iTemp); 41 | else 42 | printf("\nNumber %d is not a palindrome\n",iTemp); 43 | 44 | return 0; 45 | } 46 | -------------------------------------------------------------------------------- /VTU/Sem1_Sem2/OLD2010/CPP_Lab/.old/04Horner.c: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | *File : 04Horner.c 3 | *Description : Program to implement Horners method for Polynomial evaluation 4 | *Author : Prabodh C P 5 | *Compiler : gcc compiler, Ubuntu 8.10 6 | *Date : 7 September 2010 7 | ***************************************************************************/ 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | /*************************************************************************** 14 | *Function : main 15 | *Input parameters: no parameters 16 | *RETURNS : 0 on success 17 | ***************************************************************************/ 18 | 19 | int main(void) 20 | { 21 | 22 | int iDeg,i,iaArr[10]; 23 | float fX,fSum=0; 24 | 25 | printf("\n*********************************************************************"); 26 | printf("\n*\tPROGRAM TO EVALUATE A POLYNOMIAL USING HORNERS METHOD\t *\n"); 27 | printf("*********************************************************************"); 28 | 29 | printf("\nEnter the degree of the polynomial and value of x\n"); 30 | scanf("%d%f",&iDeg,&fX); 31 | 32 | printf("\nEnter the coefficients in descending order of degree\n"); 33 | for(i=0;i<=iDeg;i++) 34 | { 35 | scanf("%d",&iaArr[i]); 36 | } 37 | 38 | for(i=0;i 10 | #include 11 | 12 | /*************************************************************************** 13 | *Function : main 14 | *Input parameters: no parameters 15 | *RETURNS : 0 on success 16 | ***************************************************************************/ 17 | 18 | int main(void) 19 | { 20 | 21 | int iLen=0; 22 | //unsigned int i=1; 23 | unsigned int i=~0; 24 | 25 | //printf("\n%d\n",sizeof(int)); 26 | //printf("\n%lu\n",i); 27 | printf("\n*************************************************"); 28 | printf("\n*\tPROGRAM TO CALCULATE WORD LENGTH\t*\n"); 29 | printf("*************************************************"); 30 | 31 | for(i = 1; i != 0; i = i << 1) 32 | { 33 | //printf("\n%u",i); 34 | iLen++; 35 | } 36 | //printf("\n%u\n",i); 37 | printf("\n\nThe Word length of the host machine is %d\n\n", iLen); 38 | 39 | return 0; 40 | } 41 | -------------------------------------------------------------------------------- /VTU/Sem1_Sem2/OLD2010/CPP_Lab/.old/14prime.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | int main(void) 5 | { 6 | int a[200]; 7 | int n,i,k; 8 | 9 | 10 | printf("enter the value of n"); 11 | scanf("%d",&n); 12 | for(i=2;i<=n;i++) 13 | { 14 | a[i]=i; 15 | } 16 | 17 | omp_set_num_threads(5); 18 | for(k=2;k<=sqrt(n);k++) 19 | { 20 | if(a[k]!=0) 21 | { 22 | #pragma omp parallel for private(i) 23 | for(i=k*k;i<=n;i=i+k) 24 | { 25 | printf("\nThread id=%d makes %03d position zero",omp_get_thread_num(),i); 26 | a[i]=0; 27 | } 28 | } 29 | } 30 | 31 | 32 | printf("\nPrime numbers are \n"); 33 | 34 | for(i=2;i<=n;i++) 35 | { 36 | if(a[i]>0)printf("%d\t",a[i]); 37 | } 38 | printf("\n"); 39 | return 0; 40 | 41 | }//end of main 42 | 43 | 44 | /* 45 | to compile 46 | cc prime.c -fopenmp -lm 47 | 48 | to run 49 | ./a.out 50 | 51 | */ 52 | -------------------------------------------------------------------------------- /VTU/Sem1_Sem2/OLD2010/CPP_Lab/CPL.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem1_Sem2/OLD2010/CPP_Lab/CPL.pdf -------------------------------------------------------------------------------- /VTU/Sem1_Sem2/OLD2010/CPP_Lab/output/audit.txt: -------------------------------------------------------------------------------- 1 | Foremost version 1.5.7 by Jesse Kornblum, Kris Kendall, and Nick Mikus 2 | Audit File 3 | 4 | Foremost started at Thu Mar 13 22:56:08 2014 5 | Invocation: foremost image.dd 6 | Output directory: /home/branch/workspace/Lab Manual 1/CS-VTU-Lab-Manual/VTU/Sem1_Sem2/CPP_Lab/output 7 | Configuration file: /etc/foremost.conf 8 | ------------------------------------------------------------------ 9 | File: stdin 10 | Start: Thu Mar 13 22:56:08 2014 11 | Length: Unknown 12 | 13 | Num Name (bs=512) Size File Offset Comment 14 | 15 | Interrupt received at Thu Mar 13 23:06:21 2014 16 | -------------------------------------------------------------------------------- /VTU/Sem1_Sem2/Readme.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem1_Sem2/Readme.txt -------------------------------------------------------------------------------- /VTU/Sem3/DS_Lab/.old/10_heap.c: -------------------------------------------------------------------------------- 1 | /*Design, develop, and execute a program in C to create a max heap of integers by 2 | accepting one element at a time and by inserting it immediately in to the heap. Use the 3 | array representation for the heap. Display the array at the end of insertion phase.*/ 4 | 5 | #include 6 | #define MAX_ELEMENTS 200 7 | #define HEAP_FULL(n)(n==MAX_ELEMENTS-1) 8 | typedef struct{ 9 | int key; 10 | }element; 11 | element heap[MAX_ELEMENTS]; 12 | void push(int, int *); 13 | int k=0; 14 | int main() 15 | { 16 | int n,i=1,j; 17 | if(HEAP_FULL(k)) 18 | printf("The heap is full.\n"); 19 | while(i==1) 20 | { 21 | printf("Enter the element to be inserted into the heap.\n"); 22 | scanf("%d",&n); 23 | push(n,&k); 24 | printf("Enter 1 to continue insertion or any other number to display the heap.\n"); 25 | scanf("%d",&i); 26 | } 27 | printf("The elements of the heap are \n"); 28 | for(j=1;j<=k;j++) 29 | printf("%d\t",heap[j].key); 30 | printf("\n"); 31 | return 0; 32 | } 33 | void push(int n, int *k) 34 | { 35 | int i; 36 | i = ++(*k); 37 | while((i!=1)&&(n>heap[i/2].key)) 38 | { 39 | heap[i]=heap[i/2]; 40 | i/=2; 41 | } 42 | heap[i].key=n; 43 | } 44 | -------------------------------------------------------------------------------- /VTU/Sem3/DS_Lab/.old/6_String.cpp: -------------------------------------------------------------------------------- 1 | /*Design, develop, and execute a program in C++ to create a class called STRING and implement the 2 | following operations. Display the results after every operation by overloading the operator << 3 | i) STRING s1 = “VTU” 4 | ii) STRING s2 = “BELGAUM” 5 | iii) STIRNG s3 = s1 + s2; (Use copy constructor) 6 | */ 7 | #include 8 | #include 9 | using namespace std; 10 | class STRING 11 | { 12 | char str[100]; 13 | public: 14 | STRING() 15 | { 16 | strcpy(str," "); 17 | } 18 | STRING(char *s1) 19 | { 20 | strcpy(str,s1); 21 | } 22 | STRING(STRING& s) 23 | { 24 | strcpy(str,s.str); 25 | } 26 | STRING operator +(STRING ); 27 | friend ostream& operator <<(ostream& c,STRING s1) 28 | { 29 | c< 2 | #include 3 | using namespace std; 4 | 5 | const int MAX = 100; 6 | 7 | 8 | void DepthFirstSearch(int currentVertex, int v[MAX], int g[MAX][MAX], int n) 9 | { 10 | 11 | int i; 12 | 13 | v[currentVertex] = 1; 14 | 15 | for (i=0; i> numVert; 29 | 30 | for (i=0; i> graph[i][j]; 38 | 39 | for (i=0; i 4 8 | ) OR cname IN( 9 | SELECT cname 10 | FROM CLASS 11 | WHERE room = '502' 12 | ); 13 | 14 | -------------------------------------------------------------------------------- /VTU/Sem5/DB_Lab/.old/Question1/1_query3.sql: -------------------------------------------------------------------------------- 1 | SELECT DISTINCT s.sname 2 | FROM STUDENT s 3 | WHERE s.snum IN( 4 | SELECT e1.snum 5 | FROM ENROLLED e1, ENROLLED e2, CLASS c1, CLASS c2 6 | WHERE e1.snum = e2.snum AND e1.cname <> e2.cname AND e1.cname = c1.cname AND e2.cname = c2.cname AND c1.meets_at = c2.meets_at 7 | ); 8 | 9 | -------------------------------------------------------------------------------- /VTU/Sem5/DB_Lab/.old/Question1/1_query4.sql: -------------------------------------------------------------------------------- 1 | SELECT DISTINCT f.fname 2 | FROM FACULTY f 3 | WHERE NOT EXISTS ( 4 | SELECT c.room 5 | FROM CLASS c 6 | WHERE c.room NOT IN ( 7 | SELECT c1.room 8 | FROM CLASS c1 9 | WHERE c1.fid = f.fid 10 | ) 11 | ); 12 | 13 | -------------------------------------------------------------------------------- /VTU/Sem5/DB_Lab/.old/Question1/1_query5.sql: -------------------------------------------------------------------------------- 1 | SELECT DISTINCT f.fname 2 | FROM FACULTY f 3 | WHERE f.fid IN ( 4 | SELECT c.fid 5 | FROM CLASS c, ENROLLED e 6 | WHERE c.cname = e.cname GROUP BY c.cname 7 | HAVING COUNT(c.cname) < 5 8 | ); 9 | 10 | -------------------------------------------------------------------------------- /VTU/Sem5/DB_Lab/.old/Question2/2i_create.sql: -------------------------------------------------------------------------------- 1 | CREATE DATABASE AIRLINES; 2 | USE AIRLINES; 3 | 4 | CREATE TABLE IF NOT EXISTS FLIGHTS 5 | ( fno INTEGER, 6 | src VARCHAR(20), 7 | dest VARCHAR(20), 8 | distance INTEGER, 9 | departs TIME, 10 | arrives TIME, 11 | price DOUBLE, 12 | PRIMARY KEY(fno) 13 | ); 14 | 15 | CREATE TABLE IF NOT EXISTS AIRCRAFT 16 | ( aid INTEGER, 17 | aname VARCHAR(20), 18 | cruisingrange INTEGER, 19 | fno INTEGER, 20 | PRIMARY KEY(aid), 21 | FOREIGN KEY(fno) REFERENCES FLIGHTS(fno) 22 | ); 23 | 24 | CREATE TABLE IF NOT EXISTS EMPLOYEE 25 | ( eid INTEGER, 26 | ename VARCHAR(20), 27 | salary INTEGER, 28 | PRIMARY KEY(eid) 29 | ); 30 | 31 | CREATE TABLE IF NOT EXISTS CERTIFIED 32 | ( eid INTEGER, 33 | aid INTEGER, 34 | PRIMARY KEY(eid,aid), 35 | FOREIGN KEY(eid) REFERENCES EMPLOYEE(eid), 36 | FOREIGN KEY(aid) REFERENCES AIRCRAFT(aid) 37 | ); 38 | 39 | -------------------------------------------------------------------------------- /VTU/Sem5/DB_Lab/.old/Question2/2i_query1.sql: -------------------------------------------------------------------------------- 1 | 2 | SELECT DISTINCT a.aname 3 | FROM AIRCRAFT a 4 | WHERE a.aid IN ( 5 | SELECT DISTINCT c.aid 6 | FROM CERTIFIED c 7 | WHERE eid IN ( 8 | SELECT DISTINCT eid 9 | FROM EMPLOYEE 10 | WHERE salary > 80000 11 | ) 12 | ); 13 | 14 | 15 | SELECT DISTINCT a.aname 16 | FROM AIRCRAFT a 17 | WHERE a.aid IN ( 18 | SELECT c.aid 19 | FROM CERTIFIED c, EMPLOYEE e 20 | WHERE c.eid = e.eid AND NOT EXISTS( 21 | SELECT * 22 | FROM EMPLOYEE e1 23 | WHERE e1.eid = e.eid AND salary < 80000 24 | ) 25 | ); 26 | 27 | -------------------------------------------------------------------------------- /VTU/Sem5/DB_Lab/.old/Question2/2i_query2.sql: -------------------------------------------------------------------------------- 1 | SELECT c.eid, MAX(cruisingrange) 2 | FROM CERTIFIED c, AIRCRAFT a 3 | WHERE c.aid = a.aid GROUP BY c.eid HAVING count(*)>3; 4 | 5 | -------------------------------------------------------------------------------- /VTU/Sem5/DB_Lab/.old/Question2/2i_query3.sql: -------------------------------------------------------------------------------- 1 | SELECT DISTINCT e.ename 2 | FROM EMPLOYEE e 3 | WHERE e.salary < ( 4 | SELECT MIN(f.price) 5 | FROM FLIGHTS f 6 | WHERE f.src = "BLR" AND f.dest ="DEL" 7 | ); 8 | 9 | UPDATE EMPLOYEE SET salary = (salary / 1000) 10 | WHERE eid IN(1,3,6,9,15); 11 | 12 | 13 | SELECT DISTINCT e.ename 14 | FROM EMPLOYEE e 15 | WHERE e.salary < ( 16 | SELECT MIN(f.price) 17 | FROM FLIGHTS f 18 | WHERE f.src = "BLR" AND f.dest ="DEL" 19 | ); 20 | 21 | -------------------------------------------------------------------------------- /VTU/Sem5/DB_Lab/.old/Question2/2i_query4.sql: -------------------------------------------------------------------------------- 1 | SELECT a.aname, AVG(e.salary) 2 | FROM AIRCRAFT a, EMPLOYEE e, CERTIFIED c 3 | WHERE e.eid = c.eid AND a.aid = c.aid AND a.cruisingrange > 1000 4 | GROUP BY a.aname; 5 | 6 | -------------------------------------------------------------------------------- /VTU/Sem5/DB_Lab/.old/Question2/2i_query5.sql: -------------------------------------------------------------------------------- 1 | SELECT DISTINCT e.ename 2 | FROM EMPLOYEE e, CERTIFIED c, AIRCRAFT a 3 | WHERE e.eid = c.eid AND c.aid = a.aid AND a.aname like "boeing%" 4 | 5 | -------------------------------------------------------------------------------- /VTU/Sem5/DB_Lab/.old/Question2/2i_query6.sql: -------------------------------------------------------------------------------- 1 | SELECT a.aid, f.fno, a.aname 2 | FROM AIRCRAFT a, FLIGHTS f 3 | WHERE f.src = "BLR" AND f.dest ="DEL" AND f.fno = a.fno; 4 | -------------------------------------------------------------------------------- /VTU/Sem5/DB_Lab/.old/Question3/3i_create.sql: -------------------------------------------------------------------------------- 1 | CREATE DATABASE COURSEADOPTION; 2 | USE COURSEADOPTION; 3 | 4 | CREATE TABLE IF NOT EXISTS STUDENT 5 | ( regno VARCHAR(9), 6 | sname VARCHAR(15), 7 | major VARCHAR(20), 8 | bdate DATE, 9 | PRIMARY KEY(regno) 10 | ); 11 | 12 | CREATE TABLE IF NOT EXISTS COURSE 13 | ( courseno INTEGER(9), 14 | cname VARCHAR(20), 15 | dept VARCHAR(20), 16 | PRIMARY KEY(courseno) 17 | ); 18 | 19 | CREATE TABLE IF NOT EXISTS ENROL 20 | ( regno VARCHAR(9), 21 | courseno INTEGER(9), 22 | sem INTEGER(9) , 23 | marks INTEGER(5), 24 | PRIMARY KEY(regno,courseno), 25 | FOREIGN KEY(regno) REFERENCES STUDENT(regno), 26 | FOREIGN KEY(courseno) REFERENCES COURSE(courseno) 27 | ); 28 | 29 | CREATE TABLE IF NOT EXISTS TEXT 30 | ( book_isbn INTEGER(9), 31 | book_title VARCHAR(30), 32 | publisher VARCHAR(23), 33 | author VARCHAR(27), 34 | PRIMARY KEY(book_isbn) 35 | ); 36 | 37 | CREATE TABLE IF NOT EXISTS BOOK_ADOPTION 38 | ( courseno INTEGER(9) REFERENCES COURSE(courseno), 39 | book_isbn INTEGER(9) REFERENCES TEXT(book_isbn), 40 | sem INTEGER(9), 41 | PRIMARY KEY(courseno,book_isbn), 42 | FOREIGN KEY(courseno) REFERENCES COURSE(courseno), 43 | FOREIGN KEY(book_isbn) REFERENCES TEXT(book_isbn) 44 | ); 45 | 46 | 47 | -------------------------------------------------------------------------------- /VTU/Sem5/DB_Lab/.old/Question3/3iii_soln.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO TEXT VALUES(1013, 'K and R C', 'Tata McGraw Hill', 'Kernighan and Ritchie'); 2 | INSERT INTO BOOK_ADOPTION VALUES(101, 1013, 7); 3 | SELECT * FROM TEXT; 4 | SELECT * FROM BOOK_ADOPTION ; 5 | -------------------------------------------------------------------------------- /VTU/Sem5/DB_Lab/.old/Question3/3iv_soln.sql: -------------------------------------------------------------------------------- 1 | SELECT book_title,b.book_isbn,courseno FROM TEXT t,BOOK_ADOPTION b 2 | WHERE t.book_isbn=b.book_isbn AND courseno IN ( 3 | SELECT courseno FROM BOOK_ADOPTION 4 | WHERE courseno IN (SELECT courseno FROM COURSE WHERE dept='Computer Science') 5 | GROUP BY courseno HAVING count(courseno)>2) 6 | ORDER BY book_title; 7 | -------------------------------------------------------------------------------- /VTU/Sem5/DB_Lab/.old/Question3/3v_soln.sql: -------------------------------------------------------------------------------- 1 | SELECT c.dept,b.book_isbn,t.book_title,t.publisher 2 | FROM COURSE c,BOOK_ADOPTION b,TEXT t 3 | WHERE c.courseno=b.courseno AND b.book_isbn=t.book_isbn AND c.dept='Computer Science'AND t.publisher='Tata McGraw Hill'; 4 | 5 | #You can replace values for c.dept and t.publisher with suitable values for other departments and publishers 6 | -------------------------------------------------------------------------------- /VTU/Sem5/DB_Lab/.old/Question4/4i_create.sql: -------------------------------------------------------------------------------- 1 | CREATE DATABASE BOOK; 2 | USE BOOK; 3 | CREATE TABLE IF NOT EXISTS AUTHOR 4 | ( authorid INTEGER(8), 5 | aname VARCHAR(25), 6 | acity VARCHAR(15), 7 | acountry VARCHAR(15), 8 | PRIMARY KEY(authorid) 9 | ); 10 | 11 | CREATE TABLE IF NOT EXISTS PUBLISHER 12 | ( publisherid INTEGER(8), 13 | pname VARCHAR(25), 14 | pcity VARCHAR(15), 15 | pcountry VARCHAR(15), 16 | PRIMARY KEY(publisherid) 17 | ); 18 | 19 | CREATE TABLE IF NOT EXISTS CATEGORY 20 | ( categoryid INTEGER(8), 21 | description VARCHAR(25), 22 | PRIMARY KEY(categoryid) 23 | ); 24 | 25 | CREATE TABLE IF NOT EXISTS CATALOG 26 | ( bookid INTEGER(8), 27 | title VARCHAR(25), 28 | authorid INTEGER(8) , 29 | publisherid INTEGER(8), 30 | categoryid INTEGER(8), 31 | year INTEGER(4), 32 | price DECIMAL(6,2), 33 | PRIMARY KEY(bookid), 34 | FOREIGN KEY(authorid) REFERENCES AUTHOR(authorid), 35 | FOREIGN KEY(publisherid) REFERENCES PUBLISHER(publisherid), 36 | FOREIGN KEY(categoryid) REFERENCES CATEGORY(categoryid) 37 | ); 38 | 39 | CREATE TABLE IF NOT EXISTS ORDER_DETAILS 40 | ( orderno INTEGER(8), 41 | bookid INTEGER(8), 42 | quantity INTEGER(8), 43 | PRIMARY KEY(orderno), 44 | FOREIGN KEY(bookid) REFERENCES CATALOG(bookid) 45 | ); 46 | 47 | -------------------------------------------------------------------------------- /VTU/Sem5/DB_Lab/.old/Question4/4iii_soln.sql: -------------------------------------------------------------------------------- 1 | SELECT a.authorid,aname,price,title,year FROM AUTHOR a,CATALOG c 2 | WHERE a.authorid=c.authorid 3 | AND year>2000 4 | AND price>(SELECT avg(price) FROM CATALOG) 5 | AND a.authorid IN (SELECT authorid FROM CATALOG GROUP BY authorid HAVING count(authorid)>=1); 6 | -------------------------------------------------------------------------------- /VTU/Sem5/DB_Lab/.old/Question4/4iv_soln.sql: -------------------------------------------------------------------------------- 1 | SELECT a.aname FROM AUTHOR a,CATALOG c WHERE a.authorid=c.authorid AND 2 | c.bookid IN (SELECT bookid FROM ORDER_DETAILS GROUP BY bookid HAVING 3 | SUM(quantity)>=ALL(SELECT SUM(quantity) FROM ORDER_DETAILS GROUP BY bookid)); 4 | -------------------------------------------------------------------------------- /VTU/Sem5/DB_Lab/.old/Question4/4v_soln.sql: -------------------------------------------------------------------------------- 1 | UPDATE CATALOG SET price=(1.10*price) WHERE publisherid = 2 | (SELECT publisherid FROM PUBLISHER WHERE pname ='Pearson Education'); 3 | -------------------------------------------------------------------------------- /VTU/Sem5/DB_Lab/.old/Question5/5i_create.sql: -------------------------------------------------------------------------------- 1 | CREATE DATABASE BANK; 2 | USE BANK; 3 | CREATE TABLE IF NOT EXISTS BRANCH 4 | ( branchname VARCHAR(15), 5 | branchcity VARCHAR(15), 6 | assets DECIMAL(10,2), 7 | PRIMARY KEY(branchname) 8 | ); 9 | 10 | CREATE TABLE IF NOT EXISTS ACCOUNT 11 | ( accno INTEGER(8), 12 | branchname VARCHAR(15), 13 | balance DECIMAL(10,2), 14 | PRIMARY KEY(accno), 15 | FOREIGN KEY(branchname) REFERENCES BRANCH(branchname)ON DELETE CASCADE 16 | ); 17 | 18 | CREATE TABLE IF NOT EXISTS CUSTOMER 19 | ( customername VARCHAR(15), 20 | customerstreet VARCHAR(15), 21 | customercity VARCHAR(15), 22 | PRIMARY KEY(customername) 23 | ); 24 | 25 | CREATE TABLE IF NOT EXISTS LOAN 26 | ( loan_number INTEGER(8), 27 | branchname VARCHAR(15), 28 | amount DECIMAL(10,2), 29 | PRIMARY KEY(loan_number), 30 | FOREIGN KEY(branchname) REFERENCES BRANCH(branchname) 31 | 32 | ); 33 | 34 | CREATE TABLE IF NOT EXISTS DEPOSITOR 35 | ( customername VARCHAR(15), 36 | accno INTEGER, 37 | PRIMARY KEY(customername, accno), 38 | FOREIGN KEY(customername) REFERENCES CUSTOMER(customername), 39 | FOREIGN KEY(accno) REFERENCES ACCOUNT(accno) 40 | ); 41 | 42 | CREATE TABLE IF NOT EXISTS BORROWER 43 | ( customername VARCHAR(15), 44 | loan_number INTEGER(8), 45 | PRIMARY KEY(customername, loan_number), 46 | FOREIGN KEY(customername) REFERENCES CUSTOMER(customername), 47 | FOREIGN KEY(loan_number) REFERENCES LOAN(loan_number) 48 | ); 49 | 50 | 51 | -------------------------------------------------------------------------------- /VTU/Sem5/DB_Lab/.old/Question5/5iii_soln.sql: -------------------------------------------------------------------------------- 1 | SELECT customername FROM DEPOSITOR D,ACCOUNT A WHERE 2 | D.accno=A.accno AND A.branchname='Main' 3 | GROUP BY D.customername HAVING COUNT(D.customername)>1; 4 | 5 | -------------------------------------------------------------------------------- /VTU/Sem5/DB_Lab/.old/Question5/5iv_soln.sql: -------------------------------------------------------------------------------- 1 | CREATE VIEW BANKVIEW AS( 2 | SELECT DISTINCT customername,b.branchname,branchcity 3 | FROM DEPOSITOR d,ACCOUNT a,BRANCH b 4 | WHERE d.accno=a.accno AND a.branchname=b.branchname AND b.branchcity='Bangalore'); 5 | 6 | SELECT customername 7 | FROM BANKVIEW 8 | GROUP BY customername 9 | HAVING count(customername)=( 10 | SELECT count(*) 11 | FROM BRANCH 12 | WHERE branchcity='Bangalore'); 13 | 14 | -------------------------------------------------------------------------------- /VTU/Sem5/DB_Lab/.old/Question5/5v_soln.sql: -------------------------------------------------------------------------------- 1 | DELETE FROM ACCOUNT 2 | WHERE branchname IN (SELECT branchname 3 | FROM BRANCH 4 | WHERE branchcity='Bangalore'); 5 | 6 | -------------------------------------------------------------------------------- /VTU/Sem5/DB_Lab/00_Introduction_to_MySQL/DBScreenShots/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem5/DB_Lab/00_Introduction_to_MySQL/DBScreenShots/1.png -------------------------------------------------------------------------------- /VTU/Sem5/DB_Lab/00_Introduction_to_MySQL/DBScreenShots/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem5/DB_Lab/00_Introduction_to_MySQL/DBScreenShots/2.png -------------------------------------------------------------------------------- /VTU/Sem5/DB_Lab/00_Introduction_to_MySQL/DBScreenShots/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem5/DB_Lab/00_Introduction_to_MySQL/DBScreenShots/3.png -------------------------------------------------------------------------------- /VTU/Sem5/DB_Lab/00_Introduction_to_MySQL/DBScreenShots/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem5/DB_Lab/00_Introduction_to_MySQL/DBScreenShots/4.png -------------------------------------------------------------------------------- /VTU/Sem5/DB_Lab/00_Introduction_to_MySQL/DBScreenShots/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem5/DB_Lab/00_Introduction_to_MySQL/DBScreenShots/5.png -------------------------------------------------------------------------------- /VTU/Sem5/DB_Lab/00_Introduction_to_MySQL/DBScreenShots/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem5/DB_Lab/00_Introduction_to_MySQL/DBScreenShots/6.png -------------------------------------------------------------------------------- /VTU/Sem5/DB_Lab/Back.md: -------------------------------------------------------------------------------- 1 | ![Alt text](back.png) 2 | -------------------------------------------------------------------------------- /VTU/Sem5/DB_Lab/Content.md: -------------------------------------------------------------------------------- 1 | # Content 2 | 3 | 1. Foreword 4 | 2. Contributors 5 | 3. About 6 | 4. Introduction to MySQL 7 | 5. Syllabus 8 | 6. Problem 1: Student Class 9 | 7. Problem 2: Airline Flight 10 | 8. Problem 3: Student Course Books 11 | 9. Problem 4: Book dealer 12 | 10. Problem 5: Banking Enterprise 13 | -------------------------------------------------------------------------------- /VTU/Sem5/DB_Lab/DB_CSE_5thSem.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem5/DB_Lab/DB_CSE_5thSem.pdf -------------------------------------------------------------------------------- /VTU/Sem5/DB_Lab/README.md: -------------------------------------------------------------------------------- 1 | ![Alt text](cover.png) 2 | -------------------------------------------------------------------------------- /VTU/Sem5/DB_Lab/SUMMARY.md: -------------------------------------------------------------------------------- 1 | # Summary 2 | 3 | * [Content](Content.md) 4 | * [Foreword](Foreword.md) 5 | * [Contributors](Contributors.md) 6 | * [About](About.md) 7 | * [Introduction to MySQL](00_Introduction_to_MySQL/Introduction_to_MySQL.md) 8 | * [Syllabus](SYLLABUS.md) 9 | * [Problem 1: Student Class](01_StudentClass/01_StudentClass.md) 10 | * [Problem 2: Airline Flight](02_AirlineFlight/02_AirlineFlight.md) 11 | * [Problem 3: Student Course Books](03_StudentCoursesBooks/03_StudentCoursesBooks.md) 12 | * [Problem 4: Book dealer](04_BookDealer/04_BookDealer.md) 13 | * [Problem 5: Banking Enterprise](05_BankingEnterprise/05_BankingEnterprise.md) 14 | 15 | 16 | -------------------------------------------------------------------------------- /VTU/Sem5/DB_Lab/back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem5/DB_Lab/back.png -------------------------------------------------------------------------------- /VTU/Sem5/DB_Lab/cover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem5/DB_Lab/cover.png -------------------------------------------------------------------------------- /VTU/Sem5/Readme.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem5/Readme.txt -------------------------------------------------------------------------------- /VTU/Sem5/SS_OS_Lab/.old/11.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | int main() 4 | { 5 | int n,a[100],i; 6 | omp_set_num_threads(2); 7 | printf("enter the no of terms of fibonacci series which have to be generated\n"); 8 | scanf("%d",&n); 9 | a[0]=0; 10 | a[1]=1; 11 | #pragma omp parallel 12 | { 13 | #pragma omp single 14 | for(i=2;i 3 | int char_count=0,word_count=0,line_count=0,space_count=0; 4 | %} 5 | %% 6 | [^ \t\n]+ {word_count++;char_count+=yyleng;} 7 | \n {line_count++;char_count++;} 8 | " " {space_count++;char_count++;} 9 | . {char_count++;} 10 | %% 11 | int main(int argc,char *argv[]) 12 | { 13 | if(argc>1) 14 | { 15 | FILE *file=fopen(argv[1],"r"); 16 | if(!file) 17 | { 18 | printf("Error opening %s\n",argv[1]); 19 | exit(1); 20 | } 21 | yyin=file; 22 | } 23 | yylex(); 24 | printf("line count is %d\n",line_count); 25 | printf("word count is %d\n",word_count); 26 | printf("space count is %d\n",space_count); 27 | printf("character count is %d\n",char_count); 28 | return 0; 29 | } 30 | -------------------------------------------------------------------------------- /VTU/Sem5/SS_OS_Lab/.old/1b.l: -------------------------------------------------------------------------------- 1 | %{ 2 | #include 3 | int c=0; 4 | %} 5 | %x COMMENT 6 | %% 7 | "//".* {c++;} 8 | "/*".* {BEGIN COMMENT;} 9 | . ; 10 | \n ; 11 | "*/" {BEGIN 0;c++;} 12 | %% 13 | int main(int argc,char **argv) 14 | { 15 | if(argc!=3) 16 | { 17 | printf("No file\n"); 18 | return 0; 19 | } 20 | else 21 | { 22 | yyin=fopen(argv[1],"r"); 23 | yyout=fopen(argv[2],"w"); 24 | yylex(); 25 | printf("Number of comments is %d\n",c); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /VTU/Sem5/SS_OS_Lab/.old/2a.l: -------------------------------------------------------------------------------- 1 | %{ 2 | #include 3 | int a[4]={0,0,0,0}; 4 | int valid=1,i; 5 | int nop=0; 6 | %} 7 | %x OPER 8 | %% 9 | [a-zA-Z0-9]+ {BEGIN OPER;nop++;} 10 | "+" {if(valid) {valid=0;i=0;}else ext();} 11 | "-" {if(valid) {valid=0;i=1;}else ext();} 12 | "*" {if(valid) {valid=0;i=2;}else ext();} 13 | "/" {if(valid) {valid=0;i=3;}else ext();} 14 | [a-zA-Z0-9]+ {nop++;if(valid==0){valid=1;a[i]++;}else ext();} 15 | . {if(valid){valid=0;ext();}else return 0;} 16 | "\n" {if(valid==0){ext();}else return 0;} 17 | . ext(); 18 | \n ext(); 19 | %% 20 | int ext() 21 | { 22 | printf("Invalid expression\n"); 23 | exit(0); 24 | } 25 | int main() 26 | { 27 | printf("Enter expression\n"); 28 | yylex(); 29 | printf("Expression is valid\n"); 30 | printf("No. of '+' is:%d\n",a[0]); 31 | printf("No. of '-' is:%d\n",a[1]); 32 | printf("No. of '*' is:%d\n",a[2]); 33 | printf("No. of '/' is:%d\n",a[3]); 34 | printf("No. of operands is:%d\n",nop); 35 | return 0; 36 | } 37 | -------------------------------------------------------------------------------- /VTU/Sem5/SS_OS_Lab/.old/2b.l: -------------------------------------------------------------------------------- 1 | %{ 2 | #include 3 | int valid=1; 4 | %} 5 | id [a-zA-Z0-9]* 6 | %% 7 | {id}" and "{id} {valid=0;} 8 | {id}" or "{id} {valid=0;} 9 | {id}" but "{id} {valid=0;} 10 | {id}" between "{id} {valid=0;} 11 | . ; 12 | \n {return 0;} 13 | %% 14 | main() 15 | { 16 | printf("Enter a sentence\n"); 17 | yylex(); 18 | if(valid==1) 19 | printf("Its a simple sentence\n"); 20 | else 21 | printf("Its a compound sentence\n"); 22 | } 23 | -------------------------------------------------------------------------------- /VTU/Sem5/SS_OS_Lab/.old/3.l: -------------------------------------------------------------------------------- 1 | %{ 2 | #include 3 | int intcount=0,floatcount=0,charcount=0,doublecount=0; 4 | %} 5 | ID [a-zA-Z][a-zA-Z0-9]* 6 | I "int" 7 | F "float" 8 | C "char" 9 | D "double" 10 | %s DEFN 11 | %s DEFN2 12 | %s DEFN3 13 | %s DEFN4 14 | %% 15 | [\t] ; 16 | {I} {BEGIN DEFN;} 17 | {ID}"," {intcount++;printf("%s\n",yytext);} 18 | {ID}";" {intcount++;BEGIN 0;printf("%s\n",yytext);} 19 | {F} {BEGIN DEFN2;} 20 | {ID}"," {floatcount++;printf("%s\n",yytext);} 21 | {ID}";" {floatcount++;BEGIN 0;printf("%s\n",yytext);} 22 | {C} {BEGIN DEFN3;} 23 | {ID}"," {charcount++;printf("%s\n",yytext);} 24 | {ID}";" {charcount++;BEGIN 0;printf("%s\n",yytext);} 25 | {D} {BEGIN DEFN4;} 26 | {ID}"," {doublecount++;printf("%s\n",yytext);} 27 | {ID}";" {doublecount++;BEGIN 0;printf("%s\n",yytext);} 28 | . ; 29 | \n ; 30 | %% 31 | int main(int argc,char **argv) 32 | { 33 | if(argc!=2) 34 | { 35 | printf("Error\n"); 36 | return 0; 37 | } 38 | yyin=fopen(argv[1],"r"); 39 | printf("The identifiers are:\n"); 40 | yylex(); 41 | printf("the no. of int identifiers are %d\n",intcount); 42 | printf("the no. of float identifiers are %d\n",floatcount); 43 | printf("the no. of char identifiers are %d\n",charcount); 44 | printf("the no. of double identifiers are %d\n",doublecount); 45 | return 0; 46 | } 47 | -------------------------------------------------------------------------------- /VTU/Sem5/SS_OS_Lab/.old/4a.l: -------------------------------------------------------------------------------- 1 | %{ 2 | #include"y.tab.h" 3 | %} 4 | %% 5 | [0-9]+ return NUMBER; 6 | [a-zA-Z][a-zA-Z0-9]* return ID; 7 | . return yytext[0]; 8 | \n return 0; 9 | %% 10 | -------------------------------------------------------------------------------- /VTU/Sem5/SS_OS_Lab/.old/4a.y: -------------------------------------------------------------------------------- 1 | %{ 2 | #include 3 | #include 4 | %} 5 | %token NUMBER ID 6 | %left '+''-' 7 | %left '*''/' 8 | %% 9 | exp:exp'+'exp 10 | |exp'-'exp 11 | |exp'*'exp 12 | |exp'/'exp 13 | |NUMBER 14 | |ID; 15 | %% 16 | yyerror() 17 | { 18 | printf("Invalid expression\n"); 19 | exit(0); 20 | } 21 | int main() 22 | { 23 | printf("Enter the expression\n"); 24 | yyparse(); 25 | printf("Valid expression\n"); 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /VTU/Sem5/SS_OS_Lab/.old/4b.l: -------------------------------------------------------------------------------- 1 | %{ 2 | #include"y.tab.h" 3 | %} 4 | %% 5 | [0-9] return DIGIT; 6 | [a-zA-Z] return ALPHA; 7 | . return yytext[0]; 8 | \n return 0; 9 | %% 10 | -------------------------------------------------------------------------------- /VTU/Sem5/SS_OS_Lab/.old/4b.y: -------------------------------------------------------------------------------- 1 | %{ 2 | #include 3 | #include 4 | %} 5 | %token DIGIT ALPHA 6 | %% 7 | variable:ALPHA 8 | |variable ALPHA 9 | | variable DIGIT 10 | ; 11 | %% 12 | yyerror() 13 | { 14 | printf("Invalid expression\n"); 15 | exit(0); 16 | } 17 | int main() 18 | { 19 | printf("Enter the variable\n"); 20 | yyparse(); 21 | printf("Valid variable\n"); 22 | return 0; 23 | } 24 | 25 | -------------------------------------------------------------------------------- /VTU/Sem5/SS_OS_Lab/.old/5a.l: -------------------------------------------------------------------------------- 1 | %{ 2 | #include"y.tab.h" 3 | extern int yylval; 4 | %} 5 | [0-9]+ {yylval=atoi(yytext);return NUMBER;} 6 | . return yytext[0] 7 | \n return 0; 8 | %% 9 | -------------------------------------------------------------------------------- /VTU/Sem5/SS_OS_Lab/.old/5a.y: -------------------------------------------------------------------------------- 1 | %{ 2 | #include 3 | #include 4 | %} 5 | %token NUMBER 6 | %left '+''-' 7 | %left '*''/' 8 | %% 9 | exp:expr {printf("Result is %d\n",$1);return 0;} 10 | expr:expr'+'expr {$$=$1+$3;} 11 | |expr'-'expr {$$=$1-$3;} 12 | |expr'*'expr {$$=$1*$3;} 13 | |expr'/'expr 14 | { 15 | if($3==0) 16 | yyerror("divide by zero!!!"); 17 | else 18 | $$=$1/$3' 19 | } 20 | |'('expr')' {$$=$2;} 21 | |NUMBER 22 | ; 23 | %% 24 | yyerror() 25 | { 26 | printf("Invalid expression\n"); 27 | exit(0); 28 | } 29 | main() 30 | { 31 | printf("Enter the expression\n"); 32 | yyparse(); 33 | printf("Valid expression\n"); 34 | } 35 | -------------------------------------------------------------------------------- /VTU/Sem5/SS_OS_Lab/.old/5b.l: -------------------------------------------------------------------------------- 1 | %{ 2 | #include"y.tab.h" 3 | %} 4 | %% 5 | a return A; 6 | b return B; 7 | . return yytext[0]; 8 | \n return 0; 9 | %% 10 | -------------------------------------------------------------------------------- /VTU/Sem5/SS_OS_Lab/.old/5b.y: -------------------------------------------------------------------------------- 1 | %{ 2 | #include 3 | #include 4 | %} 5 | % token A B; 6 | %% 7 | S:A S B 8 | | 9 | ; 10 | %% 11 | yyerror() 12 | { 13 | printf("Invalid\n"); 14 | exit(0); 15 | } 16 | main() 17 | { 18 | printf("enter a string of a's and b's\n"); 19 | yyparse(); 20 | printf("valid grammar\n"); 21 | } 22 | -------------------------------------------------------------------------------- /VTU/Sem5/SS_OS_Lab/.old/6.l: -------------------------------------------------------------------------------- 1 | %{ 2 | #include"y.tab.h" 3 | %} 4 | %% 5 | a return A; 6 | b return B; 7 | . return yytext[0]; 8 | \n return 0; 9 | %% 10 | -------------------------------------------------------------------------------- /VTU/Sem5/SS_OS_Lab/.old/6.y: -------------------------------------------------------------------------------- 1 | %{ 2 | #include 3 | #include 4 | int count=0; 5 | %} 6 | % token A B; 7 | %% 8 | S: X B 9 | X: X A {count++;} 10 | | 11 | ; 12 | %% 13 | yyerror() 14 | { 15 | printf("Invalid\n"); 16 | exit(0); 17 | } 18 | main() 19 | { 20 | printf("enter a string of a's and b's\n"); 21 | yyparse(); 22 | if(count>=10) 23 | printf("valid grammar\n"); 24 | else 25 | printf("Invalid grammar\n"); 26 | } 27 | -------------------------------------------------------------------------------- /VTU/Sem5/SS_OS_Lab/.old/7a.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | if [ $# -eq 0 ] 3 | then 4 | echo "no arguments" 5 | exit 6 | fi 7 | echo "the total number of arguments are $#" 8 | echo "the arguments are $*" 9 | for i in $@ 10 | do 11 | rev=$i" "$rev 12 | done 13 | echo "$rev" 14 | 15 | -------------------------------------------------------------------------------- /VTU/Sem5/SS_OS_Lab/.old/7b.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | char cmd[10]; 7 | int ch; 8 | pid_t pid; 9 | if((pid=fork())<0) 10 | { 11 | printf("fork error\n"); 12 | return 0; 13 | } 14 | if(pid==0) 15 | { 16 | printf("i am parent process\n"); 17 | printf("process id =%d\n",getpid()); 18 | printf("parent process id=%d\n",getppid()); 19 | scanf("%s",cmd); 20 | system(cmd); 21 | 22 | } 23 | else 24 | { 25 | printf("%d",getpid()); 26 | printf("%d",getppid()); 27 | wait(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /VTU/Sem5/SS_OS_Lab/.old/8a.sh: -------------------------------------------------------------------------------- 1 | 2 | #!/bin/sh 3 | 4 | if [ $# -ne 2 ] 5 | then 6 | echo " please enter 2 arguments" 7 | exit 8 | fi 9 | perm1=`ls -l $1|cut -c 1-10` 10 | perm2=`ls -l $2|cut -c 1-10` 11 | if [ $perm1 = $perm2 ] 12 | then 13 | echo "Permissions are same for both files" 14 | echo "permissions are: $perm1" 15 | exit 16 | fi 17 | str1=`ls -l $1|cut -c 2-4` 18 | str2=`ls -l $2|cut -c 2-4` 19 | if [ $str1 = $str2 ] 20 | then 21 | echo "Owner permissions are same: $str1 " 22 | else 23 | echo "Owner permissions are different" 24 | echo " Permissions for file $1 : $str1 " 25 | echo " Permissions for file $2 : $str2 " 26 | fi 27 | str3=`ls -l $1|cut -c 5-7` 28 | str4=`ls -l $2|cut -c 5-7` 29 | if [ $str3 = $str4 ] 30 | then 31 | echo "Group permissions are same: $str3 " 32 | else 33 | echo "Group permissions are different" 34 | echo " Permissions for file $1 : $str3 " 35 | echo " Permissions for file $2 : $str4 " 36 | fi 37 | str5=`ls -l $1|cut -c 8-10` 38 | str6=`ls -l $2|cut -c 8-10` 39 | if [ $str5 = $str6 ] 40 | then 41 | echo "Other's permissions are same: $str5 " 42 | else 43 | echo "Other's permissions are different" 44 | echo " Permissions for file $1 : $str5 " 45 | echo " Permissions for file $2 : $str6 " 46 | fi 47 | 48 | -------------------------------------------------------------------------------- /VTU/Sem5/SS_OS_Lab/.old/8b.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int main() 6 | { 7 | int fd; 8 | char buf2[16]="ABCDEFGHIJKLMNOP"; 9 | char buf1[16]="abcdefghijklmnop"; 10 | 11 | fd=open("data.txt",O_RDWR|O_CREAT|O_EXCL,0765); 12 | 13 | if(fd==-1) 14 | printf("Error creating file"); 15 | else 16 | write(fd,buf1,16); 17 | lseek(fd,32,SEEK_CUR); 18 | write(fd,buf2,16); 19 | system(" vi data.txt"); 20 | close(fd); 21 | } 22 | 23 | 24 | -------------------------------------------------------------------------------- /VTU/Sem5/SS_OS_Lab/.old/9a.sh: -------------------------------------------------------------------------------- 1 | if [ $# -eq 0 ] 2 | then 3 | echo "error" 4 | exit 5 | fi 6 | for i in $* 7 | do 8 | echo "extracting $i file" >> f.sh 9 | cat $i >> f.sh 10 | echo "EOF" >> f.sh 11 | done 12 | cat f.sh 13 | 14 | -------------------------------------------------------------------------------- /VTU/Sem5/SS_OS_Lab/.old/9b.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | int main() 5 | { 6 | pid_t p; 7 | if((p=fork())<0) 8 | { 9 | printf("fork error\n"); 10 | return 0; 11 | } 12 | else if(p==0) 13 | { 14 | printf("i am child process\n"); 15 | printf("my parent process id is:%d\n",getppid()); 16 | printf("my process id is:%d\n",getpid()); 17 | } 18 | else 19 | { 20 | wait(); 21 | printf("i am parent process\n"); 22 | printf("my child process id is:%d\n",p); 23 | printf("my own id is: %d\n",getpid()); 24 | } 25 | return 0; 26 | } 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /VTU/Sem5/SS_OS_Lab/01aCharacterCount/01aCharacterCount.md: -------------------------------------------------------------------------------- 1 | # AIM: 2 | Program to count the number of characters, words, spaces and lines 3 | in a given input file. 4 | 5 | ## DESCRIPTION: 6 | We have the command 'wc' in UNIX which gives us all the 7 | number of characters,number of words,number of lines.We are expected to develop a similar utility which does the same using flex. 8 | 9 | ## FLEX: flex - the fast lexical analyser generator. 10 | 11 | 12 | 13 | 14 | ## CODE: 15 | 16 |
%{
17 | #include<stdio.h>
18 | int char_count=0,word_count=0,line_count=0,space_count=0;
19 | %}
20 | %%
21 | [^ \t\n]+ {word_count++;char_count+=yyleng;}
22 | \n {line_count++;char_count++;}
23 | " " {space_count++;char_count++;}
24 | . {char_count++;}
25 | %%
26 | int main(int argc,char *argv[])
27 | {
28 | 	if(argc>1)
29 | 	{
30 | 		FILE *file=fopen(argv[1],"r");
31 | 		if(!file)
32 | 		{
33 | 			printf("Error opening %s\n",argv[1]);
34 | 			exit(1);
35 | 		}
36 | 		yyin=file;
37 | 	}
38 | 	yylex();
39 | 	printf("line count is %d\n",line_count);
40 | 	printf("word count is %d\n",word_count);
41 | 	printf("space count is %d\n",space_count);
42 | 	printf("character count is %d\n",char_count);
43 | 	return 0;
44 | }
45 | 46 | ## COMPILE: 47 |
lex 1a.l
48 | gcc lex.yy.c -ll
49 | ./a.out 1a.l
50 | 51 | ## OUTPUT: 52 |
line count is 29
53 | word count is 55
54 | space count is 26
55 | character count is 588
56 | -------------------------------------------------------------------------------- /VTU/Sem5/SS_OS_Lab/02bRecognizeSentence/02bRecognizeSentence.md: -------------------------------------------------------------------------------- 1 | # AIM: 2 | Program to recognize whether a given sentence is simple or compound. 3 | ## DESCRIPTION: 4 | The user is expected to develop a code which recognizes a sentence as either simple or compound.The design considers that we use and, or, but & between.The user can specify more rules as per his/her choice. 5 | 6 | ## CODE: 7 |
%{
 8 | `#`include<stdio.h>
 9 | int valid=1;
10 | %}
11 | id [a-zA-Z0-9]*
12 | %%
13 | {id}" and "{id} {valid=0;}
14 | {id}" or "{id} {valid=0;}
15 | {id}" but "{id} {valid=0;}
16 | {id}" between "{id} {valid=0;}
17 | . ;
18 | \n {return 0;}
19 | %%
20 | main()
21 | {
22 | 	printf("Enter a sentence\n");
23 | 	yylex();
24 | 	if(valid==1)
25 | 	printf("Its a simple sentence\n");
26 | 	else
27 | 	printf("Its a compound sentence\n");
28 | }
29 | ## OUTPUT: 30 |
Enter a sentence
31 | hi and bye
32 | Its a compound sentence
33 | 34 |
Enter a sentence
35 | anand
36 | Its a simple sentence
37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /VTU/Sem5/SS_OS_Lab/04bRecognizeVariable/04bRecognizeVariable.md: -------------------------------------------------------------------------------- 1 | ## Program : 4b.y 2 | ## Aim: 3 | Program to recognize a valid variable, which starts with a letter, followed by any number of letters or digits. 4 | 5 | ## Description: 6 | This program checks if the given variable is valid or invalid. A variable should start with a letter followed any no of letters or digits.For example a123 or aa23 or b3455 etc are valid variables.Example for invalid expression 12aa or 1cc etc. 7 | 8 | ## Code: 9 | 10 | %{ 11 | #include 12 | #include 13 | %} 14 | %token DIGIT ALPHA 15 | %% 16 | variable:ALPHA 17 | |variable ALPHA 18 | | variable DIGIT 19 | ; 20 | %% 21 | yyerror() 22 | { 23 | printf("Invalid expression\n"); 24 | exit(0); 25 | } 26 | int main() 27 | { 28 | printf("Enter the variable\n"); 29 | yyparse(); 30 | printf("Valid variable\n"); 31 | return 0; 32 | } 33 | 34 | ## Program : 4b.l (Lex Specification) 35 | 36 | ## Code: 37 | %{ 38 | #include"y.tab.h" 39 | %} 40 | %% 41 | [0-9] return DIGIT; 42 | [a-zA-Z] return ALPHA; 43 | . return yytext[0]; 44 | \n return 0; 45 | %% 46 | 47 | 48 | ## Output: 49 | 1.Enter the variable 50 | 51 | a345 52 | 53 | Valid variable 54 | 55 | 2.Enter the variable 56 | 57 | 34aaa 58 | 59 | Invalid expression 60 | -------------------------------------------------------------------------------- /VTU/Sem5/SS_OS_Lab/05bRecognizeStrings/05bRecognizeStrings.md: -------------------------------------------------------------------------------- 1 | ## AIM :Program to recognize strings 'aaab', 'abbb', 'ab' and 'a' using the grammar (anbn, n>= 0). 2 | 3 | 4 | ### DESCRIPTION : 5 |

The program has three parts defination section,rule section,subroutine section. The program accepts equal number of a's and b's as valid inputs. The grammar is S->A S B, A->a ,b->b .

6 | 7 | ### ALGORITHM : 8 | 9 | 10 | ### CODE : 11 | 12 |
%{
13 | #include
14 | #include
15 | %}
16 | %token A B;
17 | %%
18 | S:A S B
19 |  |
20 |  ;
21 | %% 
22 | yyerror()
23 | {
24 | 	printf("Invalid\n");
25 | 	exit(0);
26 | }
27 | main()
28 | {
29 | 	printf("enter a string of a's and b's\n");
30 | 	yyparse();
31 | 	printf("valid grammar\n");
32 | }
33 | 34 | 35 | 36 | ### LEX SPECIFICATION 37 | 38 |
39 | %{
40 | #include"y.tab.h"
41 | %}
42 | %%
43 | a return A;
44 | b return B;
45 | . return yytext[0];
46 | \n return 0;
47 | %%
48 | 49 | ### OUTPUT : 50 | 51 |
enter a string of a's and b's
52 | aaab
53 | Invalid grammar
54 | 
55 | enter a string of a's and b's
56 | abbb
57 | Invalid grammar
58 | 
59 | enter a string of a's and b's
60 | ab
61 | valid grammar
62 | 
63 | enter a string of a's and b's
64 | a
65 | Invalid grammar
66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /VTU/Sem5/SS_OS_Lab/06RecognizeGrammar/06RecognizeGrammar.md: -------------------------------------------------------------------------------- 1 | ## AIM:Program to recognize the grammar (anb, n>= 10). 2 | 3 | ### DESCRIPTION: 4 |

The program has three parts:definition section,rule section,subroutine section. The program uses a variable count to keep track of the number of A's in the input string and B is accepted only once according to the rule described.So count must be more than 9.

5 | 6 | ### ALGORITHM: 7 | 8 | ### CODE: 9 | 10 |
%{
11 | #include
12 | #include
13 | int count=0;
14 | %}
15 | %token A B;
16 | %%
17 | S: X B
18 | X: X A {count++;}
19 |  |
20 |  ;
21 | %% 
22 | yyerror()
23 | {
24 | 	printf("Invalid\n");
25 | 	exit(0);
26 | }
27 | main()
28 | {
29 | 	printf("enter a string of a's and b's\n");
30 | 	yyparse();
31 | 	if(count>=10)
32 | 	printf("valid grammar\n");
33 | 	else
34 | 	printf("Invalid grammar\n");
35 | }
36 | 37 | ### LEX SPECIFICATION: 38 | 39 |
%{
40 | #include"y.tab.h"
41 | %}
42 | %%
43 | a return A;
44 | b return B;
45 | . return yytext[0];
46 | \n return 0;
47 | %%
48 | 49 | ### OUTPUT: 50 |

1) enter a string of a's and b's

51 |

aaaaaaaaaab

52 |

valid grammar

53 | 54 |

2) enter a string of a's and b's

55 |

aaaaaab

56 |

invalid grammar

57 | -------------------------------------------------------------------------------- /VTU/Sem5/SS_OS_Lab/07aReverseOrder/07aReverseOrder.md: -------------------------------------------------------------------------------- 1 | ### Aim: 2 | Non-recursive shell script that accepts any number of arguments and prints them in the Reverse order, ( For example, if the script is named rargs, then executing rargs A B C should produce C B A on the standard output). 3 | 4 | #### Description: 5 |

$#: Contains the total number of input arguments.

6 |

$@:Contains all the input arguments 7 | 8 |

#! /bin/bash
 9 | if [ $# -eq 0 ]
10 | then
11 | 	echo "no arguments"
12 | 	exit
13 | fi
14 | echo "the total number of arguments are $#"
15 | echo "the arguments are $*"
16 | for i in $@
17 | do 
18 | 	rev=$i" "$rev
19 | done
20 | echo "$rev" 
21 | 22 | #### Output: 23 |
./7a.sh 2 7 5
24 | 5 7 2
25 | 


--------------------------------------------------------------------------------
/VTU/Sem5/SS_OS_Lab/07bShellLikeProgram/07bShellLikeProgram.md:
--------------------------------------------------------------------------------
 1 | ### Aim:
 2 | C program that creates a child process to read commands from the standard input and execute them (a minimal implementation of a shell-like program). You can assume that no arguments will be passed to the commands to be executed.
 3 | 
 4 | #### Description:
 5 |  

fork():it is a system call which forks a new child of a processs 6 |

system ():it is a system call which takes a command as an argument and invokes the operating system to execute it.

7 | 8 | #### Code: 9 |
10 | #include<stdio.h>
11 | #include<stdlib.h>
12 | #include<sys/types.h>
13 | int main()
14 |   {
15 |   char cmd[20];
16 |   system("clear");
17 |   do{
18 |     printf("[PROMPT]$\n");
19 |     gets(cmd);
20 |     system(cmd);
21 |     }while(strcmp(cmd,"exit"));
22 | }
23 | 
24 | #### Output: 25 | 26 | /a.out 27 | 28 | [PROMPT]$ 29 | echo "Hello world" 30 |
Hello world!
31 | 32 | [PROMPT]$ 33 | date 34 |
Wed Oct 29 21:40:20 IST 2014
35 | [PROMPT]$ 36 | exit 37 |
38 | 
39 | 
40 | -------------------------------------------------------------------------------- /VTU/Sem5/SS_OS_Lab/09aBundleScript/09aBundleScript.md: -------------------------------------------------------------------------------- 1 | ### Aim: 2 | Shell script that accepts file names specified as arguments and creates a shell script that contains this file as well as the code to recreate these files. Thus if the script generated by your script is executed, it would recreate the original files(This is same as the "bundle" script described by Brain W. Kernighan and Rob Pike in "The Unix Programming Environment", Prentice - Hall India). 3 | 4 | #### Description: 5 |

$#: Contains the total number of input arguments.

6 |

$@:Contains all the input arguments 7 | #### Code: 8 |

if [ $# -eq 0 ]
 9 | then
10 | echo "error"
11 | exit
12 | fi
13 | for i in $*
14 |  do 
15 |    echo "extracting $i file" >> f.sh
16 |    cat $i >> f.sh
17 |    echo "EOF" >> f.sh
18 |  done
19 | cat f.sh 
20 | 
21 | #### Compile: ./2.sh 1.c 22 | 23 | #### Output: 24 |
extracting 1.c file
25 | `#`include<stdio.h>
26 | `#`include<stdlib.h>
27 | `#`include<string.h>
28 | `#`include<unistd.h>
29 | int main()
30 | {
31 | int pid,n,i;
32 | char cmd[14];
33 | system("clear");
34 | printf("enter the no. of commands:\n");
35 | scanf("%d",&n);
36 | pid=fork();
37 | if(pid)
38 | {
39 |  for(i=0;i<n;i++)
40 |  {
41 |    printf("\nEnter command:\n");
42 |    scanf("%s",cmd);
43 |    system (cmd);
44 |   }
45 | }
46 | return 0;
47 | }
48 | EOF
49 | 
-------------------------------------------------------------------------------- /VTU/Sem5/SS_OS_Lab/09bChildProcessIDs/09bChildProcessIDs.md: -------------------------------------------------------------------------------- 1 | ### Aim: 2 | C program to do the following: Using fork( ) create a child process.The child process prints its own process-id and id of its parent and then exits. The parent process waits for its child to finish (by executing the wait( )) and prints its own process-id and the id of its child process and then exits. 3 | 4 | ### Description: 5 |

pid_t:parent id of the process. 6 |

fork():it is a system call which forks a new child of a processs

7 | 8 | ### Code: 9 |
`#`include<stdio.h>
10 | `#`include<unistd.h>
11 | `#`include<stdlib.h>
12 | int main()
13 | {
14 | 	pid_t p;
15 | 	if((p=fork())<0)
16 | 	{
17 | 		printf("fork error\n");
18 | 		return 0;
19 | 	}
20 | 	else if(p==0)
21 | 	{
22 | 		printf("i am child process\n");
23 | 		printf("my parent process id is:%d\n",getppid());
24 | 		printf("my process id is:%d\n",getpid());
25 | 	}
26 | 	else
27 | 	{
28 | 		wait();
29 | 		printf("i am parent process\n");
30 | 		printf("my child process id is:%d\n",p);
31 | 		printf("my own id is: %d\n",getpid());
32 | 	}
33 | 	return 0;
34 | }
35 | 36 | ### Output: 37 |
i am child process
38 | my parent process id is:4273
39 | my process id is:4274
40 | i am parent process
41 | my child process id is:4274
42 | my own id is: 4273
43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /VTU/Sem6/CG_Lab/02LiangBasky/liang.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem6/CG_Lab/02LiangBasky/liang.png -------------------------------------------------------------------------------- /VTU/Sem6/CG_Lab/02LiangBasky/liangAlgo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem6/CG_Lab/02LiangBasky/liangAlgo.png -------------------------------------------------------------------------------- /VTU/Sem6/CG_Lab/03SpinCube/spincube.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem6/CG_Lab/03SpinCube/spincube.png -------------------------------------------------------------------------------- /VTU/Sem6/CG_Lab/04RotateHouse/rthouse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem6/CG_Lab/04RotateHouse/rthouse.png -------------------------------------------------------------------------------- /VTU/Sem6/CG_Lab/05CohenSutherland/cohen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem6/CG_Lab/05CohenSutherland/cohen.png -------------------------------------------------------------------------------- /VTU/Sem6/CG_Lab/06parallelopiped/parallelopiped.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem6/CG_Lab/06parallelopiped/parallelopiped.png -------------------------------------------------------------------------------- /VTU/Sem6/CG_Lab/07teapot/teapot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem6/CG_Lab/07teapot/teapot.png -------------------------------------------------------------------------------- /VTU/Sem6/CG_Lab/08moveCube/movecube.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem6/CG_Lab/08moveCube/movecube.png -------------------------------------------------------------------------------- /VTU/Sem6/CG_Lab/09scanFill/scanfill.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem6/CG_Lab/09scanFill/scanfill.png -------------------------------------------------------------------------------- /VTU/Sem6/CG_Lab/10rectMesh/mesh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem6/CG_Lab/10rectMesh/mesh.png -------------------------------------------------------------------------------- /VTU/Sem6/CG_Lab/CG.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem6/CG_Lab/CG.pdf -------------------------------------------------------------------------------- /VTU/Sem6/Readme.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem6/Readme.txt -------------------------------------------------------------------------------- /VTU/Sem6/USP_CD_Lab/.old/C_files/01_get_limits.cpp: -------------------------------------------------------------------------------- 1 | /*Write a C/C++ POSIX compliant program to check the following limits: 2 | (i) No. of clock ticks 3 | (ii) Max. no. of child processes 4 | (iii) Max. path length 5 | (iv) Max. no. of characters in a file name 6 | (v) Max. no. of open files/ process 7 | */ 8 | 9 | 10 | #define _POSIX_SOURCE 11 | #define _POSIX_C_SOURCE 199309L 12 | #include "iostream" 13 | #include 14 | using namespace std; 15 | int main() 16 | { 17 | cout<<"No of clock ticks:"< 8 | using namespace std; 9 | int main() 10 | { 11 | #ifdef _POSIX_JOB_CONTROL 12 | cout<<"System supports POSIX job control:"<<_POSIX_JOB_CONTROL< 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | using namespace std; 14 | #define BUFFER_SIZE PIPE_BUF 15 | int main(int argc,char *argv[]) 16 | { 17 | int pipe_fd,res=0; 18 | char buffer[BUFFER_SIZE+1]; 19 | if(argc!=2) 20 | { 21 | cout<<"usage:./a.out pipe_name\n"; 22 | return -1; 23 | } 24 | cout<<"\nFD of fifo in read mode:"< 5 | #include 6 | #include 7 | static void charatatime(char *); 8 | int main() 9 | { 10 | int pid; 11 | if((pid=fork())<0) 12 | printf("fork error\n"); 13 | else if(pid==0) 14 | charatatime("output from child\n"); 15 | else 16 | charatatime("output from parent\n"); 17 | _exit(0); 18 | } 19 | static void charatatime(char *str) 20 | { 21 | char *ptr; 22 | int c; 23 | setbuf(stdout,NULL); 24 | for(ptr=str;(c=*ptr++)!=0;) 25 | putc(c,stdout); 26 | } 27 | -------------------------------------------------------------------------------- /VTU/Sem6/USP_CD_Lab/.old/C_files/07_zombie.c: -------------------------------------------------------------------------------- 1 | ##Aim: 2 | 3 | /* Write a C/C++ program that creates a zombie and then calls system to execute the ps 4 | command to verify that the process is zombie. */ 5 | #include 6 | #include 7 | #include 8 | int main() 9 | { 10 | int pid; 11 | if((pid=fork())<0) 12 | printf("fork error\n"); 13 | else if(pid==0) 14 | _exit(0); 15 | sleep(2); 16 | system( "ps -o pid,ppid,state,tty,command"); 17 | _exit(0); 18 | } 19 | -------------------------------------------------------------------------------- /VTU/Sem6/USP_CD_Lab/.old/C_files/08_avoid_zombie.c: -------------------------------------------------------------------------------- 1 | /*Write a C/C++ program to avoid zombie process by forking twice.*/ 2 | #include 3 | #include 4 | #include 5 | int main() 6 | { 7 | int pid; 8 | if((pid=fork())<0) 9 | printf("fork error\n"); 10 | else if(pid==0) 11 | { 12 | if((pid=fork())<0) 13 | printf("fork error\n"); 14 | else if(pid>0) 15 | _exit(0); 16 | sleep(2); 17 | printf("second child,parent pid:%d\n",getppid()); 18 | _exit(0); 19 | } 20 | _exit(0); 21 | } 22 | -------------------------------------------------------------------------------- /VTU/Sem6/USP_CD_Lab/.old/C_files/09_my_system.c: -------------------------------------------------------------------------------- 1 | /*Write a C/C++ program to implement the system function.*/ 2 | /* Note : TO run use ./a.out command1 command2 ,..., commandn 3 | where each command is a shell command 4 | Example : ./a.out ps date who 5 | */ 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | void sys(const char *cmdstr) 13 | { 14 | int pid; 15 | pid=fork(); 16 | if(pid==0) 17 | execl("/bin/bash","bash","-c",cmdstr,NULL); 18 | else 19 | waitpid(pid,NULL,0); 20 | } 21 | int main(int argc,char *argv[]) 22 | { 23 | int i; 24 | for(i=1;i 3 | #include 4 | #include 5 | #include 6 | #define INTERVAL 5 7 | void callme(int sig_no) 8 | { 9 | alarm(INTERVAL); 10 | printf("Hello!!\n"); 11 | } 12 | int main() 13 | { 14 | struct sigaction action; 15 | action.sa_handler=(void(*)(int))callme; 16 | sigaction(SIGALRM,&action,0); 17 | alarm(2); 18 | sleep(5); 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /VTU/Sem6/USP_CD_Lab/.old/usp-lab-07/usp-lab-07.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem6/USP_CD_Lab/.old/usp-lab-07/usp-lab-07.png -------------------------------------------------------------------------------- /VTU/Sem6/USP_CD_Lab/01GetLimits/usp-lab-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem6/USP_CD_Lab/01GetLimits/usp-lab-01.png -------------------------------------------------------------------------------- /VTU/Sem6/USP_CD_Lab/02PosixConfiguration/02_output.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem6/USP_CD_Lab/02PosixConfiguration/02_output.png -------------------------------------------------------------------------------- /VTU/Sem6/USP_CD_Lab/03FileLock/out1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem6/USP_CD_Lab/03FileLock/out1.png -------------------------------------------------------------------------------- /VTU/Sem6/USP_CD_Lab/03FileLock/out2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem6/USP_CD_Lab/03FileLock/out2.png -------------------------------------------------------------------------------- /VTU/Sem6/USP_CD_Lab/03FileLock/out3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem6/USP_CD_Lab/03FileLock/out3.png -------------------------------------------------------------------------------- /VTU/Sem6/USP_CD_Lab/04IpcFifoReader/pipe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem6/USP_CD_Lab/04IpcFifoReader/pipe.png -------------------------------------------------------------------------------- /VTU/Sem6/USP_CD_Lab/04IpcFifoReader/usp-lab-04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem6/USP_CD_Lab/04IpcFifoReader/usp-lab-04.png -------------------------------------------------------------------------------- /VTU/Sem6/USP_CD_Lab/05aEnvironList/5a_environlist.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | int main(int argc,char *argv[]) 4 | { 5 | char **ptr; 6 | extern char **environ; 7 | for(ptr=environ; *ptr!=0;ptr++) 8 | printf("%s\n",*ptr); 9 | return 0; 10 | } 11 | -------------------------------------------------------------------------------- /VTU/Sem6/USP_CD_Lab/05aEnvironList/5a_environlist.md: -------------------------------------------------------------------------------- 1 | ## Aim : 2 | 3 | ### Write a C/C++ program thgat output the contents of its Environment list. 4 | 5 | 6 | ## Theory : 7 | 8 | >Environment variables are a set of dynamic named values that can affect the way running processes will behave on a computer. 9 | 10 | >They are part of the operating environment in which a process runs. For example, a running process can query the value of the TEMP environment variable to discover a suitable location to store temporary files, or the HOME or USERPROFILE variable to find the directory structure owned by the user running the process. 11 | 12 | 13 | ## Code : 14 | 15 |

16 |  #include<stdio.h>
17 |  #include<unistd.h>
18 |  int main(int argc,char *argv[])
19 |  {
20 |   char **ptr;
21 |   extern char **environ;
22 |   for(ptr=environ; *ptr; ptr++)
23 |    printf("%s\n",*ptr);
24 |   return 0;
25 |  }
26 | 
27 | 28 | 29 | 30 | ## Output: 31 |
    32 |
  • Open a terminal.
  • 33 |
  • Change directory to the file location in both the terminals.
  • 34 |
  • Open a file using command followed by program_name
    vi 5a_environlist.c 
    and then enter the source code and save it.
  • 35 |
  • Then compile the program using
    gcc 5a_environlist.c
  • 36 |
  • If there are no errors after compilation execute the program using
    ./a.out 
  • 37 |
38 | 39 | 40 | ## Screenshot : 41 | 42 | ![Not Available](out1.png) 43 | ![Not Available](out2.png) 44 | -------------------------------------------------------------------------------- /VTU/Sem6/USP_CD_Lab/05aEnvironList/out1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem6/USP_CD_Lab/05aEnvironList/out1.png -------------------------------------------------------------------------------- /VTU/Sem6/USP_CD_Lab/05aEnvironList/out2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem6/USP_CD_Lab/05aEnvironList/out2.png -------------------------------------------------------------------------------- /VTU/Sem6/USP_CD_Lab/05bUnixLnCommand/5b_unix_ln-command.c: -------------------------------------------------------------------------------- 1 | /*5b) Write a C / C++ program to emulate the unix ln command*/ 2 | #include 3 | #include 4 | int main(int argc, char *argv[]) 5 | { 6 | if(argc!=3) 7 | { 8 | printf("Usage: %s \n",argv[0]); 9 | return 0; 10 | } 11 | if(link(argv[1],argv[2])==-1) 12 | { 13 | printf("Link Error\n"); 14 | return 1; 15 | } 16 | printf("Files Linked\n"); 17 | printf("Inode number of linked files\n"); 18 | //display the inode linked files 19 | char str[100]; 20 | sprintf(str,"ls -i %s %s\n",argv[1],argv[2]); 21 | system(str); 22 | return 0; 23 | } 24 | -------------------------------------------------------------------------------- /VTU/Sem6/USP_CD_Lab/05bUnixLnCommand/output5b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem6/USP_CD_Lab/05bUnixLnCommand/output5b.png -------------------------------------------------------------------------------- /VTU/Sem6/USP_CD_Lab/06RaceCondition/usp-lab-06a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem6/USP_CD_Lab/06RaceCondition/usp-lab-06a.png -------------------------------------------------------------------------------- /VTU/Sem6/USP_CD_Lab/06RaceCondition/usp-lab-06b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem6/USP_CD_Lab/06RaceCondition/usp-lab-06b.png -------------------------------------------------------------------------------- /VTU/Sem6/USP_CD_Lab/07CreateZombie/usp-lab-07.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem6/USP_CD_Lab/07CreateZombie/usp-lab-07.png -------------------------------------------------------------------------------- /VTU/Sem6/USP_CD_Lab/08AvoidZombie/usp-lab-08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem6/USP_CD_Lab/08AvoidZombie/usp-lab-08.png -------------------------------------------------------------------------------- /VTU/Sem6/USP_CD_Lab/09MySystem/09_my_system.c: -------------------------------------------------------------------------------- 1 | /*Write a C/C++ program to implement the system function.*/ 2 | /* Note : TO run use ./a.out command1 command2 ,..., commandn 3 | where each command is a shell command 4 | Example : ./a.out ps date who 5 | */ 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | void sys(const char *cmdstr) 13 | { 14 | int pid; 15 | pid=fork(); 16 | if(pid==0) 17 | execl("/bin/bash","bash","-c",cmdstr,NULL); 18 | else 19 | waitpid(pid,NULL,0); 20 | } 21 | int main(int argc,char *argv[]) 22 | { 23 | int i; 24 | for(i=1;i 3 | #include 4 | #include 5 | #include 6 | #define INTERVAL 5 7 | void callme(int sig_no) 8 | { 9 | alarm(INTERVAL); 10 | printf("Hello!!\n"); 11 | } 12 | int main() 13 | { 14 | struct sigaction action; 15 | action.sa_handler=(void(*)(int))callme; 16 | sigaction(SIGALRM,&action,0); 17 | alarm(2); 18 | sleep(5); 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /VTU/Sem6/USP_CD_Lab/10AlarmSignalHandler/Output.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem6/USP_CD_Lab/10AlarmSignalHandler/Output.png -------------------------------------------------------------------------------- /VTU/Sem6/USP_CD_Lab/11SyntaxDirectedDefinition/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem6/USP_CD_Lab/11SyntaxDirectedDefinition/a.out -------------------------------------------------------------------------------- /VTU/Sem6/USP_CD_Lab/11SyntaxDirectedDefinition/sdd_cd.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | char input[60],stmt[3][60]; 5 | int len,cur,i,j; 6 | void gen() 7 | { 8 | int l1=101,l2=102,l3=103; 9 | printf("if %s goto %d\n",stmt[0],l1); 10 | printf("goto %d\n",l2); 11 | printf("%d:%s\n",l1,stmt[1]); 12 | if(cur<3) 13 | printf("%d:STOP\n",l2); 14 | else 15 | { 16 | printf("goto %d\n",l3); 17 | printf("%d:%s\n",l2,stmt[2]); 18 | printf("%d:STOP\n",l3); 19 | } 20 | } 21 | int main() 22 | { 23 | printf("Format of if stmt\nExample\n"); 24 | printf("if(a 25 | 26 | ### Output: 27 | *Steps for checking output-* 28 | 29 | * Save the .php file in the folder `/var/www` 30 | * Change the file permission of the PHP file by running the command `sudo chmod 777 10.php` 31 | * Open a browser and in the address bar type `localhost/10.php` 32 | * The output is displayed on the browser with the last visit time. On sucessive refresh, the timestamp gets updated. 33 | 34 | ### Screenshot: 35 | 36 | ![output_1](10.png) -------------------------------------------------------------------------------- /VTU/Sem7/WP_Lab/010_Session/10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem7/WP_Lab/010_Session/10.png -------------------------------------------------------------------------------- /VTU/Sem7/WP_Lab/01_Fibonacci_Squares/1a_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem7/WP_Lab/01_Fibonacci_Squares/1a_1.png -------------------------------------------------------------------------------- /VTU/Sem7/WP_Lab/01_Fibonacci_Squares/1a_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem7/WP_Lab/01_Fibonacci_Squares/1a_2.png -------------------------------------------------------------------------------- /VTU/Sem7/WP_Lab/01_Fibonacci_Squares/1a_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem7/WP_Lab/01_Fibonacci_Squares/1a_3.png -------------------------------------------------------------------------------- /VTU/Sem7/WP_Lab/01_Fibonacci_Squares/1a_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem7/WP_Lab/01_Fibonacci_Squares/1a_4.png -------------------------------------------------------------------------------- /VTU/Sem7/WP_Lab/01_Fibonacci_Squares/1b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem7/WP_Lab/01_Fibonacci_Squares/1b.png -------------------------------------------------------------------------------- /VTU/Sem7/WP_Lab/02_USN_SEM/2a_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem7/WP_Lab/02_USN_SEM/2a_1.png -------------------------------------------------------------------------------- /VTU/Sem7/WP_Lab/02_USN_SEM/2a_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem7/WP_Lab/02_USN_SEM/2a_2.png -------------------------------------------------------------------------------- /VTU/Sem7/WP_Lab/02_USN_SEM/2b_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem7/WP_Lab/02_USN_SEM/2b_1.png -------------------------------------------------------------------------------- /VTU/Sem7/WP_Lab/02_USN_SEM/2b_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem7/WP_Lab/02_USN_SEM/2b_2.png -------------------------------------------------------------------------------- /VTU/Sem7/WP_Lab/02_USN_SEM/2b_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem7/WP_Lab/02_USN_SEM/2b_3.png -------------------------------------------------------------------------------- /VTU/Sem7/WP_Lab/03_StackOrdering/3a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem7/WP_Lab/03_StackOrdering/3a.png -------------------------------------------------------------------------------- /VTU/Sem7/WP_Lab/03_StackOrdering/3b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem7/WP_Lab/03_StackOrdering/3b.png -------------------------------------------------------------------------------- /VTU/Sem7/WP_Lab/04_StudentInfo/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem7/WP_Lab/04_StudentInfo/4.png -------------------------------------------------------------------------------- /VTU/Sem7/WP_Lab/05_ServerInfo_UnixCommand/5a_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem7/WP_Lab/05_ServerInfo_UnixCommand/5a_1.png -------------------------------------------------------------------------------- /VTU/Sem7/WP_Lab/05_ServerInfo_UnixCommand/5a_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem7/WP_Lab/05_ServerInfo_UnixCommand/5a_2.png -------------------------------------------------------------------------------- /VTU/Sem7/WP_Lab/05_ServerInfo_UnixCommand/5b_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem7/WP_Lab/05_ServerInfo_UnixCommand/5b_1.png -------------------------------------------------------------------------------- /VTU/Sem7/WP_Lab/05_ServerInfo_UnixCommand/5b_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem7/WP_Lab/05_ServerInfo_UnixCommand/5b_2.png -------------------------------------------------------------------------------- /VTU/Sem7/WP_Lab/05_ServerInfo_UnixCommand/5b_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem7/WP_Lab/05_ServerInfo_UnixCommand/5b_3.png -------------------------------------------------------------------------------- /VTU/Sem7/WP_Lab/06_Greeting_TrackVisitors/6a_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem7/WP_Lab/06_Greeting_TrackVisitors/6a_1.png -------------------------------------------------------------------------------- /VTU/Sem7/WP_Lab/06_Greeting_TrackVisitors/6a_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem7/WP_Lab/06_Greeting_TrackVisitors/6a_2.png -------------------------------------------------------------------------------- /VTU/Sem7/WP_Lab/06_Greeting_TrackVisitors/6a_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem7/WP_Lab/06_Greeting_TrackVisitors/6a_3.png -------------------------------------------------------------------------------- /VTU/Sem7/WP_Lab/06_Greeting_TrackVisitors/6a_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem7/WP_Lab/06_Greeting_TrackVisitors/6a_4.png -------------------------------------------------------------------------------- /VTU/Sem7/WP_Lab/06_Greeting_TrackVisitors/6b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem7/WP_Lab/06_Greeting_TrackVisitors/6b.png -------------------------------------------------------------------------------- /VTU/Sem7/WP_Lab/07_DigitalClock/7.md: -------------------------------------------------------------------------------- 1 | ## Program 7: Write a Perl program to display a digital clock which displays the current time of the server. 2 | *** 3 | 4 | ### Tags used: 5 | 'Refresh:1' - used to dislay the refreshed time every second 6 | localtime() - uses the current time. 7 | 8 | ### Code: 9 | *7.html* 10 | 11 | 12 |
13 |
14 | 15 |
16 |
17 | 18 | 19 | *7.pl* 20 | 21 | #!/usr/bin/perl 22 | use CGI':standard'; 23 | #refresh the display every second 24 | print "Refresh:1\n"; 25 | print "Content-type:text/html\n\n"; 26 | ($s,$m,$h)=localtime(time); 27 | print br "The current server time is $h:$m:$s"; 28 | print br "In words,the time is- $h hours, $m minutes and $s seconds"; 29 | 30 | ### Output: 31 | *Steps for checking output-* 32 | 33 | * Save the .html file in the folder `/var/www/html` 34 | * Save the .pl files in the folder `/var/www/cgi-bin` 35 | * Change the file permission of the perl file by running the command `sudo chmod 777 7.pl` 36 | * Open a browser and in the address bar type `localhost/html/7.html` 37 | * Click the button `Click_to_display_time` to view the current time of the server. 38 | 39 | ### Screenshot: 40 | 41 | ![output_1](7.png) -------------------------------------------------------------------------------- /VTU/Sem7/WP_Lab/07_DigitalClock/7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem7/WP_Lab/07_DigitalClock/7.png -------------------------------------------------------------------------------- /VTU/Sem7/WP_Lab/08_PerlMySQl/8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem7/WP_Lab/08_PerlMySQl/8.png -------------------------------------------------------------------------------- /VTU/Sem7/WP_Lab/09_Cookie/9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem7/WP_Lab/09_Cookie/9.png -------------------------------------------------------------------------------- /VTU/Sem7/WP_Lab/11_PhpMySQl/11_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem7/WP_Lab/11_PhpMySQl/11_1.png -------------------------------------------------------------------------------- /VTU/Sem7/WP_Lab/11_PhpMySQl/11_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem7/WP_Lab/11_PhpMySQl/11_2.png -------------------------------------------------------------------------------- /VTU/Sem7/WP_Lab/12_RailsApplication/12_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem7/WP_Lab/12_RailsApplication/12_1.png -------------------------------------------------------------------------------- /VTU/Sem7/WP_Lab/12_RailsApplication/12_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem7/WP_Lab/12_RailsApplication/12_2.png -------------------------------------------------------------------------------- /VTU/Sem7/WP_Lab/12_RailsApplication/12_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem7/WP_Lab/12_RailsApplication/12_3.png -------------------------------------------------------------------------------- /VTU/Sem7/WP_Lab/12_RailsApplication/books_controller.rb: -------------------------------------------------------------------------------- 1 | class BooksController < ApplicationController 2 | def add 3 | Book.create(:access_no=> params[:b_access_no],:title=> params[:b_title],:author=> params[:b_author],:edition=> params[:b_edition],:publisher=> params[:b_publisher]) 4 | redirect_to :action => 'index' 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /VTU/Sem7/WP_Lab/12_RailsApplication/index.html.erb: -------------------------------------------------------------------------------- 1 |

Books#index

2 |

Books

3 |
4 |
5 |

Add a book

6 | <%= form_tag("/books/add", :method=>"post") do %> 7 | Access No:<%= text_field_tag(:b_access_no) %>
8 | Title: <%= text_field_tag(:b_title) %> 9 |
Author: <%= text_field_tag(:b_author) %> 10 |
Edition: <%= text_field_tag(:b_edition) %> 11 |
Publisher: <%= text_field_tag(:b_publisher) %> 12 |

<%= submit_tag("Add Book") %>
13 | <% end %> 14 | 15 |
16 |
17 |

Search for a book

18 | <%= form_tag("/books/search", :method=>"post") do %> 19 | Title: <%= text_field_tag(:bs_title) %> 20 |

<%= submit_tag("Search") %>
21 | <% end %> 22 | 23 |
24 | 25 |
26 | -------------------------------------------------------------------------------- /VTU/Sem7/WP_Lab/12_RailsApplication/l5_pages.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem7/WP_Lab/12_RailsApplication/l5_pages.png -------------------------------------------------------------------------------- /VTU/Sem7/WP_Lab/12_RailsApplication/l6_block_dia_vc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsmk/CS-VTU-Lab-Manual/50f7594cf6ec770cdd9c5ac6dbfd75c03d6aedec/VTU/Sem7/WP_Lab/12_RailsApplication/l6_block_dia_vc.png -------------------------------------------------------------------------------- /VTU/Sem7/WP_Lab/12_RailsApplication/search.html.erb: -------------------------------------------------------------------------------- 1 |

Search Result

2 |
3 |
4 | 5 | 6 | <% @t=Book.find_by_title(params[:bs_title]) %> 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |
Access No.TitleAuthorEditionPublisher
<%= @t.access_no %> <%= @t.title %> <%= @t.author %> <%= @t.edition %> <%= @t.publisher %>
23 |
24 |
25 |

26 | 27 | Back 28 | 29 | --------------------------------------------------------------------------------