├── .gitignore ├── CNAME ├── _config.yml ├── archives ├── README.md └── VI Semester │ ├── Internet-and-Web-Technologies │ ├── 8_PHP_session │ │ └── session.php │ ├── 7_PHP_cookie │ │ └── cookie.php │ ├── 2_Javascript │ │ ├── 2b.html │ │ └── 2a.html │ ├── README.md │ ├── 3_Javascript_Validation │ │ ├── 3a.html │ │ └── 3b.html │ ├── 5_XML_XSLT │ │ ├── 5a.xml │ │ └── 5b.xml │ ├── 9_MYSQL │ │ └── index.php │ ├── 1_External_CSS_Popup │ │ └── 1a.html │ └── 4_JS_stack_rise_on_top │ │ ├── 4b.html │ │ └── 4a.html │ ├── Computer-Graphics │ ├── README.md │ ├── 1_Retangular_mesh │ │ └── main.c │ ├── 4_Scan_Fill │ │ └── main.c │ ├── 2_Sierpinski_Gasket │ │ └── main.c │ ├── 3_ Parallelopiped_Cylinder │ │ └── main.c │ └── 7_Color_Cube_Movement │ │ └── main.c │ └── README.md ├── III Semester ├── OOPS-With-Java │ ├── .DS_Store │ ├── 5. Complex-Number │ │ ├── README.md │ │ └── ComplexNumberRun.java │ ├── 10. String Operations │ │ ├── c. Count-Vowels │ │ │ ├── README.md │ │ │ └── CountVowels.java │ │ ├── d. Count-Characters │ │ │ └── README.md │ │ ├── a. Middle-Character │ │ │ ├── README.md │ │ │ └── Middle.java │ │ └── b. Check-Palindrome │ │ │ ├── README.md │ │ │ └── PalindromeDemo.java │ ├── 11. Exception-Handling │ │ ├── b. Finally-Block │ │ │ ├── README.md │ │ │ └── FinallyBlock.java │ │ └── a. Array-Out-Of-Bounds │ │ │ ├── README.md │ │ │ └── ExceptionHandling.java │ ├── 8. Read-Write-File │ │ ├── README.md │ │ └── BRRead.java │ ├── 7. Net-Salary │ │ ├── README.md │ │ └── Employee.java │ ├── 1. Quadratic-Equation │ │ ├── README.md │ │ └── QuadraticEquation.java │ ├── 9. Interface │ │ ├── README.md │ │ └── MyVehicle.java │ ├── 2. Fibonacci-Sequence │ │ ├── README.md │ │ └── FibDemo.java │ ├── 6. Abstract-Class │ │ ├── README.md │ │ └── MySolid.java │ ├── 3. Matrix-Multiplication │ │ ├── README.md │ │ └── MatrixMul.java │ ├── 12. Threads │ │ ├── README.md │ │ └── MyThread.java │ ├── 4. Bitwise-Operations │ │ ├── Bitwise.java │ │ └── README.md │ └── README.md ├── Data-Structure-in-C │ ├── 10. Max_Heap │ │ ├── Simplified Program │ │ │ ├── README.md │ │ │ └── HEAP.C │ │ └── maxHeap.c │ ├── 1. Best_of_two │ │ └── BESTTWO.C │ ├── 2. USN │ │ └── USN.C │ ├── 12. BST_Array_Display │ │ └── BST.C │ ├── 5. Evaluate_Postfix_Expression │ │ └── POST_EVL.C │ ├── 3. Sparse_Matrix │ │ └── Sparse.c │ ├── 6. Working of Queue │ │ └── q_ops.c │ ├── 7. Singly_Linked_list_Operations │ │ └── SLL.C │ ├── 8. Singly_Linked_list_Stack │ │ └── sll_stack.c │ ├── README.md │ └── 4. Infix_to_Postfix │ │ └── INTOPOST.C └── README.md ├── VI Semester ├── System-Software-and-Operating-System │ ├── 5A-Grammar-anb │ │ ├── 5a.l │ │ └── 5a.y │ ├── 7B-Child-Process │ │ └── 7b.c │ ├── 10-Fibonacci-Series │ │ └── 10.c │ ├── 7A-Shell-Permissions │ │ └── 7a.sh │ ├── 5B-Strings-Using-Grammar │ │ ├── 5b.l │ │ └── 5b.y │ ├── 1B-Count-Number-of-Comments │ │ └── 1b.l │ ├── 4B-Recognize-Valid-Variable │ │ ├── 4b.l │ │ └── 4b.y │ ├── 1A-Count-Number-Of-Characters │ │ └── 1a.l │ ├── 2B-Simple-or-Compound-Sentence │ │ └── 2b.l │ ├── 3A-Count-Number-of-Identifiers │ │ └── 3a.l │ ├── 9B-Inter-Process-Communication │ │ └── 9b.c │ ├── 3B-Evaluate-Arithmetic-Expression │ │ ├── 3b.l │ │ └── 3b.y │ ├── 2A-Recognize-Valid-Arithmetic-Expression │ │ └── 2a.l │ ├── 4A-Recognize-Valid-Arithmetic-Expression │ │ ├── 4a.l │ │ └── 4a.y │ ├── README.md │ ├── 9A-Race-Condition │ │ └── 9a.c │ ├── 8B-Avoiding-Zombie-Process │ │ └── 8b.c │ ├── 8A-Zombie-Process │ │ └── 8a.c │ └── 6-Shift-Reduce-Parsing │ │ └── 6.c └── README.md ├── I & II Semester ├── Programming-in-C │ ├── 10. Standard-Deviation │ │ ├── README.md │ │ └── StandardDeviation.c │ ├── 1. Leap-Year-Largest-Number │ │ ├── LeapYear │ │ │ ├── README.md │ │ │ └── LeapYear.c │ │ └── Largest │ │ │ ├── README.md │ │ │ └── Largest.c │ ├── 8. Is-Prime-Function │ │ ├── README.md │ │ └── IsPrimeFunction.c │ ├── 2. Quadratic-Equation │ │ ├── README.md │ │ └── QuadraticEquation.c │ ├── 3. Palindrome │ │ ├── READMe.md │ │ └── Palindrome.c │ ├── 5. Binary-Search │ │ ├── README.md │ │ └── BinarySearch.c │ ├── 4. Bubble-Sort │ │ ├── BubbleSort.c │ │ └── README.md │ ├── 6. Matrices-Product │ │ ├── README.md │ │ └── MatricesProduct.c │ ├── 7. String-Concat │ │ ├── READEME.md │ │ └── Concat.c │ ├── 9. Employee-Structure │ │ ├── README.md │ │ └── EmployeeStructure.c │ └── README.md └── README.md ├── V Semester ├── Database-Management-System │ ├── Problem 2 │ │ ├── query5.sql │ │ ├── query6.sql │ │ ├── query3.sql │ │ ├── query2.sql │ │ ├── query4.sql │ │ ├── query1.sql │ │ ├── create_tables.sql │ │ ├── README.md │ │ └── fill_tables.sql │ ├── Problem 5 │ │ ├── query5.sql │ │ ├── query3.sql │ │ ├── query4.sql │ │ ├── README.md │ │ ├── create_tables.sql │ │ └── fill_tables.sql │ ├── Problem 3 │ │ ├── query3.sql │ │ ├── query5.sql │ │ ├── query4.sql │ │ ├── README.md │ │ ├── create_tables.sql │ │ └── fill_tables.sql │ ├── Problem 4 │ │ ├── query5.sql │ │ ├── query4.sql │ │ ├── query3.sql │ │ ├── README.md │ │ ├── create_tables.sql │ │ └── fill_tables.sql │ ├── Problem 1 │ │ ├── query2.sql │ │ ├── query5.sql │ │ ├── query1.sql │ │ ├── query4.sql │ │ ├── query3.sql │ │ ├── create_tables.sql │ │ ├── fill_tables.sql │ │ └── README.md │ └── README.md ├── README.md └── Computer-Networks │ ├── vector.c │ ├── rsa.c │ └── crc.c ├── IV Semester ├── Microprocessor_and_Microcontroller_Lab │ ├── Part-B │ │ ├── 4_Palindrome_8_Bit.asm │ │ ├── 3_Ones_Zeros_8_Bit.asm │ │ ├── 5_Up_Down_Counter.asm │ │ ├── 1_Largest_element_in_array.asm │ │ └── 2_Add_Sub_16_Bit.asm │ ├── Extra │ │ ├── 8255 Generate_Sine_Wave │ │ │ └── prg.asm │ │ ├── 8255 Parity │ │ │ └── prg.asm │ │ ├── 8255 Generate_Half_Full_Wave │ │ │ └── prg.asm │ │ ├── 8255 BCD_Up_Down_Counter │ │ │ └── prg.asm │ │ ├── 8086 Move_Cursor │ │ │ └── prg.asm │ │ ├── 8086 Display_System_Date │ │ │ └── prg.asm │ │ ├── 8086 NcR │ │ │ └── prg.asm │ │ └── 8086 Separate_Even_Odd │ │ │ └── prg.asm │ ├── README.md │ └── Part-A │ │ ├── 1B_Display_XxY │ │ └── 1B.asm │ │ ├── 3A_Prime_Or_Not │ │ └── 3A.asm │ │ ├── 2B_Display_Fire_Help │ │ └── 2B.asm │ │ ├── 4B_Display_System_Time │ │ └── 4B.asm │ │ ├── 4A_Palindrome_Or_Not │ │ └── 4A.asm │ │ ├── 2A_Display_ASCII │ │ └── 2A.asm │ │ ├── 1A_Binary_Search │ │ └── BSearch.asm │ │ ├── 6A_Fibonacci_Number │ │ └── 6A.asm │ │ ├── 5B_8x3_Keypad │ │ └── 5B.asm │ │ ├── 5A_Compare_Two_Strings │ │ └── 5A.asm │ │ ├── 3B_Display_Left_To_Right │ │ └── 3B.asm │ │ └── 6B_Elevator_Interface │ │ └── 6B.asm ├── ADA_Lab │ ├── README.md │ ├── 4_Floyd_Warshal │ │ ├── FLOYD.c │ │ └── WARSHALL.c │ ├── 11_Nqueen │ │ └── main.c │ ├── 3_BFS_DFS │ │ ├── DFS.c │ │ └── BFS.c │ ├── 9_Dijkstra │ │ └── main.c │ ├── 10_Sum_of_Subset │ │ └── main.c │ ├── 1_Quick_Sort │ │ └── main.c │ ├── 2_Merge_Sort │ │ └── main.c │ ├── 5_Horspool │ │ └── main.c │ ├── 8_Prims │ │ └── main.c │ ├── 7_Kruskal │ │ └── main.c │ └── 6_Knapsack │ │ └── main.c └── README.md ├── CONTRIBUTING.md ├── LICENSE └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | **/.DS_Store 2 | -------------------------------------------------------------------------------- /CNAME: -------------------------------------------------------------------------------- 1 | cselm.rishabhlakhotia.com -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-hacker -------------------------------------------------------------------------------- /archives/README.md: -------------------------------------------------------------------------------- 1 | # Archives 2 | 3 | This directory stores all the archived files/programs that are no longer to be used. 4 | -------------------------------------------------------------------------------- /III Semester/OOPS-With-Java/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rishabhlakhotia/CSE-Lab-Manual/HEAD/III Semester/OOPS-With-Java/.DS_Store -------------------------------------------------------------------------------- /III Semester/OOPS-With-Java/5. Complex-Number/README.md: -------------------------------------------------------------------------------- 1 | ## Expected Output 2 | 3 | Sum is 20.0+i30.0 4 | 5 | Difference is -10.0-i-30.0 6 | -------------------------------------------------------------------------------- /III Semester/OOPS-With-Java/10. String Operations/c. Count-Vowels/README.md: -------------------------------------------------------------------------------- 1 | ## Expected Output 2 | 3 | Enter a String : good morning 4 | 5 | Count of Vowels : 4 6 | -------------------------------------------------------------------------------- /III Semester/OOPS-With-Java/10. String Operations/d. Count-Characters/README.md: -------------------------------------------------------------------------------- 1 | ## Expected Output 2 | 3 | Enter a String : welcome 4 | 5 | Character Count in the given string : 7 6 | -------------------------------------------------------------------------------- /VI Semester/System-Software-and-Operating-System/5A-Grammar-anb/5a.l: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rishabhlakhotia/CSE-Lab-Manual/HEAD/VI Semester/System-Software-and-Operating-System/5A-Grammar-anb/5a.l -------------------------------------------------------------------------------- /VI Semester/System-Software-and-Operating-System/5A-Grammar-anb/5a.y: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rishabhlakhotia/CSE-Lab-Manual/HEAD/VI Semester/System-Software-and-Operating-System/5A-Grammar-anb/5a.y -------------------------------------------------------------------------------- /III Semester/OOPS-With-Java/10. String Operations/a. Middle-Character/README.md: -------------------------------------------------------------------------------- 1 | ## Expected Output 2 | 3 | Enter word: hello 4 | 5 | Middle = l 6 | 7 | Enter word: dsce 8 | 9 | Middle = sc 10 | -------------------------------------------------------------------------------- /VI Semester/System-Software-and-Operating-System/7B-Child-Process/7b.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rishabhlakhotia/CSE-Lab-Manual/HEAD/VI Semester/System-Software-and-Operating-System/7B-Child-Process/7b.c -------------------------------------------------------------------------------- /VI Semester/System-Software-and-Operating-System/10-Fibonacci-Series/10.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rishabhlakhotia/CSE-Lab-Manual/HEAD/VI Semester/System-Software-and-Operating-System/10-Fibonacci-Series/10.c -------------------------------------------------------------------------------- /VI Semester/System-Software-and-Operating-System/7A-Shell-Permissions/7a.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rishabhlakhotia/CSE-Lab-Manual/HEAD/VI Semester/System-Software-and-Operating-System/7A-Shell-Permissions/7a.sh -------------------------------------------------------------------------------- /III Semester/OOPS-With-Java/11. Exception-Handling/b. Finally-Block/README.md: -------------------------------------------------------------------------------- 1 | ## Expected Output 2 | 3 | java.lang.ArithmeticException: / by zero 4 | 5 | finally block is always executed 6 | 7 | rest of the code... 8 | -------------------------------------------------------------------------------- /VI Semester/System-Software-and-Operating-System/5B-Strings-Using-Grammar/5b.l: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rishabhlakhotia/CSE-Lab-Manual/HEAD/VI Semester/System-Software-and-Operating-System/5B-Strings-Using-Grammar/5b.l -------------------------------------------------------------------------------- /VI Semester/System-Software-and-Operating-System/5B-Strings-Using-Grammar/5b.y: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rishabhlakhotia/CSE-Lab-Manual/HEAD/VI Semester/System-Software-and-Operating-System/5B-Strings-Using-Grammar/5b.y -------------------------------------------------------------------------------- /VI Semester/System-Software-and-Operating-System/1B-Count-Number-of-Comments/1b.l: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rishabhlakhotia/CSE-Lab-Manual/HEAD/VI Semester/System-Software-and-Operating-System/1B-Count-Number-of-Comments/1b.l -------------------------------------------------------------------------------- /VI Semester/System-Software-and-Operating-System/4B-Recognize-Valid-Variable/4b.l: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rishabhlakhotia/CSE-Lab-Manual/HEAD/VI Semester/System-Software-and-Operating-System/4B-Recognize-Valid-Variable/4b.l -------------------------------------------------------------------------------- /VI Semester/System-Software-and-Operating-System/4B-Recognize-Valid-Variable/4b.y: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rishabhlakhotia/CSE-Lab-Manual/HEAD/VI Semester/System-Software-and-Operating-System/4B-Recognize-Valid-Variable/4b.y -------------------------------------------------------------------------------- /III Semester/Data-Structure-in-C/10. Max_Heap/Simplified Program/README.md: -------------------------------------------------------------------------------- 1 | ## Disclaimer 2 | This directory contains programs which are simplified version of main program. For examination purpose, use them on your discretion. 3 | -------------------------------------------------------------------------------- /VI Semester/System-Software-and-Operating-System/1A-Count-Number-Of-Characters/1a.l: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rishabhlakhotia/CSE-Lab-Manual/HEAD/VI Semester/System-Software-and-Operating-System/1A-Count-Number-Of-Characters/1a.l -------------------------------------------------------------------------------- /I & II Semester/Programming-in-C/10. Standard-Deviation/README.md: -------------------------------------------------------------------------------- 1 | # Important Note 2 | 3 | This program is not bug free and it may not work on all the devices. 4 | 5 | If you have a working program, feel free to make a pull request. 6 | -------------------------------------------------------------------------------- /III Semester/OOPS-With-Java/8. Read-Write-File/README.md: -------------------------------------------------------------------------------- 1 | ## Expected Output 2 | 3 | Enter characters, 'q' to quit. 4 | 5 | Welcome to DSCE q 6 | 7 | **** Lets display the contents of the file **** 8 | 9 | Welcome to DSCE 10 | -------------------------------------------------------------------------------- /VI Semester/System-Software-and-Operating-System/2B-Simple-or-Compound-Sentence/2b.l: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rishabhlakhotia/CSE-Lab-Manual/HEAD/VI Semester/System-Software-and-Operating-System/2B-Simple-or-Compound-Sentence/2b.l -------------------------------------------------------------------------------- /VI Semester/System-Software-and-Operating-System/3A-Count-Number-of-Identifiers/3a.l: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rishabhlakhotia/CSE-Lab-Manual/HEAD/VI Semester/System-Software-and-Operating-System/3A-Count-Number-of-Identifiers/3a.l -------------------------------------------------------------------------------- /VI Semester/System-Software-and-Operating-System/9B-Inter-Process-Communication/9b.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rishabhlakhotia/CSE-Lab-Manual/HEAD/VI Semester/System-Software-and-Operating-System/9B-Inter-Process-Communication/9b.c -------------------------------------------------------------------------------- /VI Semester/System-Software-and-Operating-System/3B-Evaluate-Arithmetic-Expression/3b.l: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rishabhlakhotia/CSE-Lab-Manual/HEAD/VI Semester/System-Software-and-Operating-System/3B-Evaluate-Arithmetic-Expression/3b.l -------------------------------------------------------------------------------- /VI Semester/System-Software-and-Operating-System/3B-Evaluate-Arithmetic-Expression/3b.y: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rishabhlakhotia/CSE-Lab-Manual/HEAD/VI Semester/System-Software-and-Operating-System/3B-Evaluate-Arithmetic-Expression/3b.y -------------------------------------------------------------------------------- /VI Semester/System-Software-and-Operating-System/2A-Recognize-Valid-Arithmetic-Expression/2a.l: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rishabhlakhotia/CSE-Lab-Manual/HEAD/VI Semester/System-Software-and-Operating-System/2A-Recognize-Valid-Arithmetic-Expression/2a.l -------------------------------------------------------------------------------- /VI Semester/System-Software-and-Operating-System/4A-Recognize-Valid-Arithmetic-Expression/4a.l: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rishabhlakhotia/CSE-Lab-Manual/HEAD/VI Semester/System-Software-and-Operating-System/4A-Recognize-Valid-Arithmetic-Expression/4a.l -------------------------------------------------------------------------------- /VI Semester/System-Software-and-Operating-System/4A-Recognize-Valid-Arithmetic-Expression/4a.y: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rishabhlakhotia/CSE-Lab-Manual/HEAD/VI Semester/System-Software-and-Operating-System/4A-Recognize-Valid-Arithmetic-Expression/4a.y -------------------------------------------------------------------------------- /I & II Semester/Programming-in-C/1. Leap-Year-Largest-Number/LeapYear/README.md: -------------------------------------------------------------------------------- 1 | # Expected Output 2 | 3 | Run 1: 4 | 5 | Enter the year: 2012 6 | 7 | 2012 is a leap year 8 | 9 | 10 | Run 2: 11 | 12 | Enter the year: 2015 13 | 14 | 2015 is not a leap year 15 | -------------------------------------------------------------------------------- /I & II Semester/Programming-in-C/1. Leap-Year-Largest-Number/Largest/README.md: -------------------------------------------------------------------------------- 1 | # Sample Output 2 | Run 1: 3 | 4 | Enter three numbers: 5 | 6 | 5 6 3 7 | 8 | 6 is the largest 9 | 10 | 11 | Run 2: 12 | 13 | Enter three numbers: 14 | 15 | 21 45 69 16 | 17 | 69 is the largest 18 | -------------------------------------------------------------------------------- /V Semester/Database-Management-System/Problem 2/query5.sql: -------------------------------------------------------------------------------- 1 | -- Find the names of pilots certified for some Boeing aircraft. 2 | 3 | SELECT DISTINCT E.ename 4 | FROM Employees E, Certified C, Aircraft A 5 | WHERE 6 | E.eid = C.eid AND 7 | A.aid = C.aid AND 8 | A.aname = 'Boeing' 9 | ; 10 | -------------------------------------------------------------------------------- /V Semester/Database-Management-System/Problem 5/query5.sql: -------------------------------------------------------------------------------- 1 | -- Demonstrate how you delete all account tuples at every branch located in a specific city. 2 | 3 | DELETE FROM BankAccount 4 | WHERE Branchname IN ( 5 | SELECT Branchname 6 | FROM Branch 7 | WHERE branchcity = 'BOMBAY' 8 | ) 9 | ; 10 | -------------------------------------------------------------------------------- /archives/VI Semester/Internet-and-Web-Technologies/8_PHP_session/session.php: -------------------------------------------------------------------------------- 1 | 12 | -------------------------------------------------------------------------------- /V Semester/Database-Management-System/Problem 3/query3.sql: -------------------------------------------------------------------------------- 1 | -- Demonstrate how you add a new text book to the database and make this book be adopted by some 2 | -- department. 3 | 4 | INSERT INTO Text VALUES (11, 'DATABASE FUNDAMENTALS', 'TATA MCGRAW HILL', 'SCHIELD'); 5 | INSERT INTO BookAdoption VALUES (1, 3, 11); 6 | -------------------------------------------------------------------------------- /III Semester/OOPS-With-Java/10. String Operations/b. Check-Palindrome/README.md: -------------------------------------------------------------------------------- 1 | ## Expected Output 2 | 3 | Enter a string to check if it is a palindrome: madam 4 | 5 | Entered string is a palindrome. 6 | 7 | 8 | Enter a string to check if it is a palindrome: bangalore 9 | 10 | Entered string is not a palindrome. 11 | -------------------------------------------------------------------------------- /V Semester/Database-Management-System/Problem 4/query5.sql: -------------------------------------------------------------------------------- 1 | -- Demonstrate how you increase the price of books published by a specific publisher by 10%. 2 | 3 | UPDATE Catalog 4 | SET price = (1.1) * price 5 | WHERE authorid = ( 6 | SELECT authorid 7 | FROM Author 8 | WHERE name = 'NAVATHE' 9 | ) 10 | ; 11 | -------------------------------------------------------------------------------- /III Semester/OOPS-With-Java/7. Net-Salary/README.md: -------------------------------------------------------------------------------- 1 | ## Expected Output 2 | 3 | Enter Employee id 4 | 5 | 1 6 | 7 | Enter Employee Name 8 | 9 | Aditya 10 | 11 | Enter Basic Salary 12 | 13 | 10000 14 | 15 | Employee Id= 1 16 | 17 | Emplyee Name= Shravan 18 | 19 | Gross Salary= 16250.0 20 | 21 | Net Salary = 13525.0 22 | -------------------------------------------------------------------------------- /III Semester/OOPS-With-Java/1. Quadratic-Equation/README.md: -------------------------------------------------------------------------------- 1 | ## Expected Output 2 | 3 | Given quadratic equation:ax^2 + bx + c 4 | 5 | Enter a:2 6 | 7 | Enter b:3 8 | 9 | Enter c:1 10 | 11 | Given quadratic equation:2x^2 + 3x + 1 12 | 13 | Roots are real and distinct 14 | 15 | First root is:-0.5 16 | 17 | Second root is:-1.0 18 | -------------------------------------------------------------------------------- /III Semester/OOPS-With-Java/9. Interface/README.md: -------------------------------------------------------------------------------- 1 | ## Expected Output 2 | 3 | Bus Steering is round and medium sized 4 | 5 | Always use brakes to stop the bus. 6 | 7 | Lorry Steering is round and big sized 8 | 9 | Always use brakes to stop the Lorry. 10 | 11 | Car Steering is round and small sized 12 | 13 | Always use brakes to stop the car. 14 | -------------------------------------------------------------------------------- /I & II Semester/Programming-in-C/1. Leap-Year-Largest-Number/LeapYear/LeapYear.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void main(){ 4 | int year; 5 | printf("Enter the year"); 6 | scanf("%d",&year); 7 | if(((year%4==0)&&(year%100!=0))||(year%400==0)) 8 | printf("\n%d is a leap year",year); 9 | else 10 | printf("\n%d is not a leap year",year); 11 | } 12 | -------------------------------------------------------------------------------- /III Semester/OOPS-With-Java/2. Fibonacci-Sequence/README.md: -------------------------------------------------------------------------------- 1 | ## Expected Output 2 | 3 | Enter the n value 4 | 5 | 5 6 | 7 | Fibonacci series using recursion: 8 | 9 | 0 1 1 2 3 5 10 | 11 | 5th Fibonacci value using recursion is 5 12 | 13 | 14 | Fibonacci series using iterative method: 15 | 16 | 0 1 1 2 3 5 17 | 18 | 5th Fibonacci value using iterative method is 5 19 | -------------------------------------------------------------------------------- /V Semester/Database-Management-System/Problem 1/query2.sql: -------------------------------------------------------------------------------- 1 | -- Find the names of all classes that either meet in room R128 or have five or more Students enrolled. 2 | 3 | SELECT DISTINCT C.cname 4 | FROM Class C 5 | WHERE 6 | C.room = 'R128' OR 7 | C.cname IN ( 8 | SELECT E.cname 9 | FROM Enrolled E 10 | GROUP BY E.cname 11 | HAVING COUNT(*) >= 5 12 | ) 13 | ; 14 | -------------------------------------------------------------------------------- /V Semester/Database-Management-System/Problem 2/query6.sql: -------------------------------------------------------------------------------- 1 | -- Find the aids of all aircraft that can be used on routes from Bengaluru to New Delhi. 2 | 3 | SELECT DISTINCT A.aid 4 | FROM Aircraft A 5 | WHERE A.cruisingrange > ( 6 | SELECT MIN(F.distance) 7 | FROM Flights F 8 | WHERE 9 | F.ffrom = 'Bengaluru' AND 10 | F.tto = 'New Delhi' 11 | ) 12 | ; 13 | -------------------------------------------------------------------------------- /V Semester/Database-Management-System/Problem 2/query3.sql: -------------------------------------------------------------------------------- 1 | -- Find the names of pilots whose salary is less than the price of the cheapest route from Bengaluru to Frankfurt. 2 | 3 | SELECT E.ename 4 | FROM Employees E 5 | WHERE E.salary < ( 6 | SELECT MIN(F.price) 7 | FROM Flights F 8 | WHERE 9 | F.ffrom = 'Bengaluru' AND 10 | F.tto = 'Frankfurt' 11 | ) 12 | ; 13 | -------------------------------------------------------------------------------- /V Semester/Database-Management-System/Problem 1/query5.sql: -------------------------------------------------------------------------------- 1 | -- Find the names of faculty members for whom the combined enrollment of the courses that they teach is less 2 | -- than five. 3 | 4 | SELECT DISTINCT F.fname 5 | FROM Faculty F 6 | WHERE 5 > ( 7 | SELECT COUNT(E.snum) 8 | FROM Class C, Enrolled E 9 | WHERE 10 | C.cname = E.cname AND 11 | C.fid = F.fid 12 | ) 13 | ; 14 | -------------------------------------------------------------------------------- /IV Semester/Microprocessor_and_Microcontroller_Lab/Part-B/4_Palindrome_8_Bit.asm: -------------------------------------------------------------------------------- 1 | ;WRITE A PROGRAM TO CHECK WHETHER GIVEN 8-BIT NUMBER IS PALINDROME OR NOT. IF PALINDROME STORE FFH IN ACCUMULATOR ELSE STORE 00H IN ACCUMULATOR. 2 | 3 | org 00h 4 | mov r0,#0xFE 5 | mov b,r0 6 | mov a,b 7 | swap a 8 | cjne a,b,label1 9 | mov a,#0xFF 10 | sjmp endp1 11 | label1: 12 | mov a,#0x00 13 | endp1: 14 | end 15 | -------------------------------------------------------------------------------- /V Semester/Database-Management-System/Problem 1/query1.sql: -------------------------------------------------------------------------------- 1 | -- Find the names of all Juniors (level = JR) who are enrolled in a class taught by Prof. Venkatesan 2 | 3 | SELECT DISTINCT S.sname 4 | FROM Student S, Enrolled E, Class C, Faculty F 5 | WHERE 6 | S.snum = E.snum AND 7 | E.cname = C.cname AND 8 | C.fid = F.fid AND 9 | F.fname = 'Prof. Venkatesan' AND 10 | S.slevel = 'JR' 11 | ; 12 | -------------------------------------------------------------------------------- /V Semester/Database-Management-System/Problem 2/query2.sql: -------------------------------------------------------------------------------- 1 | -- For each pilot who is certified for more than three aircrafts, find the eid and the maximum cruisingrange of 2 | -- the aircraft for which she or he is certified. 3 | 4 | SELECT C.eid, MAX(A.cruisingrange) 5 | FROM Certified C, Aircraft A 6 | WHERE A.aid = C.aid 7 | GROUP BY C.eid 8 | HAVING COUNT(*) > 3 9 | 10 | ; 11 | 12 | 13 | -------------------------------------------------------------------------------- /archives/VI Semester/Internet-and-Web-Technologies/7_PHP_cookie/cookie.php: -------------------------------------------------------------------------------- 1 | 13 | -------------------------------------------------------------------------------- /V Semester/Database-Management-System/Problem 1/query4.sql: -------------------------------------------------------------------------------- 1 | -- Find the names of faculty members who teach in every room in which some class is taught. 2 | 3 | SELECT DISTINCT F.fname 4 | FROM Faculty F 5 | WHERE NOT EXISTS ( 6 | SELECT * 7 | FROM Class C 8 | WHERE (C.room) NOT IN ( 9 | SELECT C1.room 10 | FROM Class C1 11 | WHERE C1.fid = F.fid 12 | ) 13 | ) 14 | ; 15 | -------------------------------------------------------------------------------- /III Semester/OOPS-With-Java/11. Exception-Handling/a. Array-Out-Of-Bounds/README.md: -------------------------------------------------------------------------------- 1 | ## Expected Output 2 | 3 | The lottery numbers are ... 4 | 5 | ..4 6 | 7 | ..8 8 | 9 | ..15 10 | 11 | ..16 12 | 13 | ..23 14 | 15 | ..42 16 | 17 | Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 6 at bc_3_sem.ArrayIndexOutofBoundExceptionExample.main(ArrayIndexOutofBoundExceptionExample.java:15) 18 | -------------------------------------------------------------------------------- /I & II Semester/Programming-in-C/8. Is-Prime-Function/README.md: -------------------------------------------------------------------------------- 1 | # Expected Output 2 | 3 | Run 1: 4 | 5 | Enter the range n1 and n2 to find prime numbers 6 | 7 | 2 15 8 | 9 | The prime numbers between 2 and 15 are 10 | 11 | 2 3 5 7 11 13 12 | 13 | 14 | Run 2: 15 | 16 | Enter the range n1 and n2 to find prime numbers 17 | 18 | 15 30 19 | 20 | The prime numbers between 15 and 30 are 21 | 22 | 17 19 23 29 23 | -------------------------------------------------------------------------------- /I & II Semester/Programming-in-C/2. Quadratic-Equation/README.md: -------------------------------------------------------------------------------- 1 | # Expected Output 2 | 3 | Run 1: 4 | 5 | Enter the non zero coefficient values of a,b and c: 1 2 1 6 | 7 | The roots are real and equal 8 | 9 | Root1=-1.000000 Root2=-1.000000 10 | 11 | 12 | 13 | Run 2: 14 | 15 | Enter the non zero coefficient values of a,b and c: 1 -5 6 16 | 17 | The roots are real and distinct 18 | 19 | Root1=3.000000 Root2=2.000000 20 | -------------------------------------------------------------------------------- /VI Semester/System-Software-and-Operating-System/README.md: -------------------------------------------------------------------------------- 1 | # System Software and Operating System Lab 2 | This repository contains all the System Software and Operating System Lab programs in the Autonomous curriculum of Dayananda Sagar College of Engineering. 3 | 4 | ## Getting Started 5 | Instructions to run each program are provided at the end. 6 | For programs with both lex and yacc, instructions are provided in the 7 | yacc file. 8 | -------------------------------------------------------------------------------- /V Semester/Database-Management-System/Problem 2/query4.sql: -------------------------------------------------------------------------------- 1 | -- For all aircraft with cruisingrange over 1000 Kms,. Find the name of the aircraft and the average salary of all 2 | -- pilots certified for this aircraft. 3 | 4 | SELECT A.aname, AVG (E.SALARY) 5 | FROM Aircraft A, Certified C, Employees E 6 | WHERE 7 | A.aid = C.aid AND 8 | C.eid = E.eid AND 9 | A.cruisingrange > 1000 10 | 11 | GROUP BY A.aid, A.aname 12 | 13 | ; 14 | -------------------------------------------------------------------------------- /I & II Semester/Programming-in-C/1. Leap-Year-Largest-Number/Largest/Largest.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void main() { 4 | 5 | // Declare Variables 6 | int a,b,c; 7 | 8 | printf("Enter three numbers:\n "); 9 | 10 | // Ask for input 11 | scanf("%d%d%d",&a,&b,&c); 12 | 13 | // Using Ternary Operator 14 | ((a>b)&&(a>c))?printf("\n%d is largest",a):(b>c)?printf("\n%d is the largest",b):printf("\n%d is the largest",c); 15 | } 16 | -------------------------------------------------------------------------------- /I & II Semester/Programming-in-C/3. Palindrome/READMe.md: -------------------------------------------------------------------------------- 1 | # Expected Output 2 | 3 | Run 1: 4 | 5 | Enter an integer number 6 | 7 | 1234 8 | 9 | Given number is: 1234 10 | 11 | It's reverse is:4321 12 | 13 | The number is not a palindrome 14 | 15 | 16 | 17 | 18 | 19 | Run 2: 20 | 21 | Enter an integer number 22 | 23 | 12321 24 | 25 | Given number is: 12321 26 | 27 | It's reverse is:12321 28 | 29 | The number is a palindrome 30 | -------------------------------------------------------------------------------- /IV Semester/Microprocessor_and_Microcontroller_Lab/Part-B/3_Ones_Zeros_8_Bit.asm: -------------------------------------------------------------------------------- 1 | ;WRITE AN ASSEMBLY LANGUAGE PROGRAM TO COUNT NUMBER OF ONES AND ZEROS IN AN EIGHT BIT NUMBER. 2 | 3 | mov r1,#00h // to count number of 0s 4 | mov r2,#00h // to count number of 1s 5 | mov r7,#08h // counter for 8-bits 6 | mov a,#0xBB // data to count number of 1s and 0s 7 | again: rlc a 8 | jc next 9 | inc r1 10 | sjmp here 11 | next: inc r2 12 | here: djnz r7,again 13 | end 14 | -------------------------------------------------------------------------------- /IV Semester/Microprocessor_and_Microcontroller_Lab/Part-B/5_Up_Down_Counter.asm: -------------------------------------------------------------------------------- 1 | ;WRITE AN ASSEMBLY LANGUAGE PROGRAM TO IMPLEMENT (DISPLAY) AN EIGHT BIT UP/DOWN BINARY (HEX) COUNTER ON WATCH WINDOW 2 | 3 | mov a,#0FFh //mov a, #00h for up counter 4 | back: acall delay 5 | dec a //inc a for binary up counter 6 | jnz back 7 | here: sjmp here 8 | delay: mov r1,#0ffh 9 | decr1: mov r2,#0ffh 10 | decr: mov r3,#0ffh 11 | djnz r3,$ 12 | djnz r2,decr 13 | djnz r1,decr1 14 | ret 15 | end 16 | -------------------------------------------------------------------------------- /III Semester/OOPS-With-Java/11. Exception-Handling/b. Finally-Block/FinallyBlock.java: -------------------------------------------------------------------------------- 1 | public class FinallyBlock { 2 | public static void main(String args[]){ 3 | 4 | try 5 | { 6 | int data=25/0; 7 | System.out.println(data); 8 | } 9 | catch(ArithmeticException e) 10 | { 11 | System.out.println(e); 12 | } 13 | finally 14 | { 15 | System.out.println("finally block is always executed"); 16 | } 17 | System.out.println("rest of the code..."); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /V Semester/Database-Management-System/Problem 5/query3.sql: -------------------------------------------------------------------------------- 1 | -- Find all the customers who have at least two accounts at the Main branch. 2 | 3 | SELECT * 4 | FROM BankCustomer C 5 | WHERE EXISTS ( 6 | SELECT D.customername, COUNT(D.customername) 7 | FROM Depositer D, BankAccount BA 8 | WHERE 9 | D.accno = BA.accno AND 10 | C.customername = D.customername AND 11 | BA.branchname = 'RESIDENCY ROAD' 12 | 13 | GROUP BY D.customername 14 | HAVING COUNT(D.customername) >= 2 15 | ) 16 | ; 17 | 18 | -------------------------------------------------------------------------------- /V Semester/Database-Management-System/Problem 1/query3.sql: -------------------------------------------------------------------------------- 1 | -- Find the names of all students who are enrolled in two classes that meet at the same time. 2 | 3 | SELECT DISTINCT S.sname 4 | FROM Student S 5 | WHERE S.snum IN ( 6 | SELECT E1.snum 7 | FROM Enrolled E1, Enrolled E2, Class C1, Class C2 8 | WHERE 9 | E1.snum = E2.snum AND 10 | E1.cname <> E2.cname AND 11 | E1.cname = C1.cname AND 12 | E2.cname = C2.cname AND 13 | C1.meets_at = C2.meets_at 14 | ) 15 | ; 16 | 17 | 18 | -------------------------------------------------------------------------------- /V Semester/Database-Management-System/Problem 2/query1.sql: -------------------------------------------------------------------------------- 1 | -- Find the names of Aircraft such that all pilots certified to operate them have salaries more than Rs.80,000. 2 | 3 | SELECT DISTINCT A.aname 4 | FROM Aircraft A 5 | WHERE A.aid IN ( 6 | SELECT C.aid 7 | FROM Certified C, Employees E 8 | WHERE 9 | C.eid = E.eid AND 10 | NOT EXISTS ( 11 | SELECT * 12 | FROM Employees E1 13 | WHERE 14 | E1.eid = E.eid AND 15 | E1.salary <= 80000 16 | ) 17 | ) 18 | ; 19 | -------------------------------------------------------------------------------- /I & II Semester/Programming-in-C/3. Palindrome/Palindrome.c: -------------------------------------------------------------------------------- 1 | #include 2 | void main(){ 3 | int n,rev=0,temp,digit; 4 | printf("Enter an integer number\n"); 5 | scanf("%d",&n); 6 | temp=n; 7 | while(n!=0){ 8 | digit=n%10; 9 | rev=rev*10+digit; 10 | n=n/10; 11 | } 12 | printf("Given number is: %d\n",temp); 13 | printf("It's reverse is:%d\n",rev); 14 | if(rev==temp) 15 | printf("The number is a palindrome\n"); 16 | else 17 | printf("The number is not a palindrome\n"); 18 | } 19 | -------------------------------------------------------------------------------- /III Semester/OOPS-With-Java/6. Abstract-Class/README.md: -------------------------------------------------------------------------------- 1 | ## Expected Output 2 | 3 | Enter the radius of cylinder 4 | 5 | 4 6 | 7 | Surface area of cylinder is 276.46015351590177 8 | 9 | Volume of the cylinder is 351.85837720205683 10 | 11 | Enter the radius of cone: 12 | 13 | 3 14 | 15 | Surface area of a cone is: 100.0513040467447 16 | 17 | Volume of cone is:65.97344572538566 18 | 19 | Enter the radius of sphere 20 | 21 | 2 22 | 23 | Surface area of a sphere is: 50.26548245743669 24 | 25 | Volume of cone is:33.510321638291124 26 | -------------------------------------------------------------------------------- /I & II Semester/Programming-in-C/5. Binary-Search/README.md: -------------------------------------------------------------------------------- 1 | # Expected Output 2 | 3 | Run 1: 4 | 5 | Enter the number of elements 6 | 7 | 6 8 | 9 | Enter 6 elements in ascending order 10 | 11 | 4 7 9 11 15 18 12 | 13 | Enter the element to search 14 | 15 | 15 16 | 17 | key found at position 5 18 | 19 | 20 | 21 | 22 | 23 | Run 2: 24 | 25 | Enter the number of elements 26 | 27 | 6 28 | 29 | Enter 6 elements in ascending order 30 | 31 | 4 7 9 11 15 18 32 | 33 | Enter the element to search 34 | 35 | 19 36 | 37 | key not found 38 | -------------------------------------------------------------------------------- /V Semester/Database-Management-System/Problem 5/query4.sql: -------------------------------------------------------------------------------- 1 | -- Find all the customers who have an account at all the branches located in a specific city. 2 | 3 | SELECT * 4 | FROM BankCustomer BC 5 | WHERE NOT EXISTS ( 6 | SELECT branchname 7 | FROM Branch 8 | WHERE 9 | branchcity = 'DELHI' AND 10 | (branchname) NOT IN ( 11 | SELECT BA.branchname 12 | FROM Depositer D, BankAccount BA 13 | WHERE 14 | D.accno = BA.accno AND 15 | BC.customername = D.customername 16 | ) 17 | ) 18 | ; 19 | -------------------------------------------------------------------------------- /V Semester/Database-Management-System/Problem 4/query4.sql: -------------------------------------------------------------------------------- 1 | -- Find the author of the book which has maximum sales. 2 | 3 | SELECT DISTINCT A.NAME 4 | FROM Author A, Catalog C, OrderDetails ODM 5 | WHERE 6 | A.authorid = C.authorid AND 7 | ODM.bookid = C.bookid AND 8 | EXISTS ( 9 | SELECT OD.bookid, SUM(OD.quantity) 10 | FROM OrderDetails OD 11 | WHERE OD.bookid = ODM.bookid 12 | GROUP BY bookid 13 | HAVING SUM(OD.quantity) >= ALL ( 14 | SELECT SUM(quantity) 15 | FROM OrderDetails 16 | GROUP BY bookid 17 | ) 18 | ) 19 | ; 20 | 21 | -------------------------------------------------------------------------------- /V Semester/Database-Management-System/Problem 3/query5.sql: -------------------------------------------------------------------------------- 1 | -- List any department that has all its adopted books published by a specific publisher. 2 | 3 | SELECT C.dept, T.booktitle, T.publisher 4 | FROM Course C, Text T, BookAdoption BA 5 | WHERE 6 | C.course = BA.course AND 7 | T.bookisbn = BA.bookisbn AND 8 | T.publisher = 'PEARSON'AND 9 | T.publisher = ALL ( 10 | SELECT T1.publisher 11 | FROM Course C1, BookAdoption BA1, Text T1 12 | WHERE 13 | BA1.bookisbn = T1.bookisbn AND 14 | BA1.course = C1.course AND 15 | C.dept = C1.dept 16 | ) 17 | ; 18 | 19 | -------------------------------------------------------------------------------- /IV Semester/Microprocessor_and_Microcontroller_Lab/Extra/8255 Generate_Sine_Wave/prg.asm: -------------------------------------------------------------------------------- 1 | .MODEL SMALL 2 | .DATA 3 | TABLE DB 127,144,161,177,191,204,214,225,227,225,221,214,204,191,177,161,144,127,110,93,77,63,50,40,33,29,27,29,33,40,50,63,77,93,110,127 4 | PA EQU 0D800H 5 | PB EQU 0D801H 6 | PC EQU 0D802H 7 | CW EQU 0D803H 8 | 9 | .CODE 10 | MOV AX,@DATA 11 | MOV DS,AX 12 | 13 | MOV DX,CW 14 | MOV AL,80H 15 | OUT DX,AL 16 | 17 | L2: 18 | MOV CX,37D 19 | MOV DX,PA 20 | LEA SI,TABLE 21 | 22 | L1: 23 | MOV AL,[SI] 24 | OUT DX,AL 25 | INC SI 26 | LOOP L1 27 | 28 | JMP L2 29 | 30 | MOV AH,4CH 31 | INT 21H 32 | END 33 | -------------------------------------------------------------------------------- /archives/VI Semester/Computer-Graphics/README.md: -------------------------------------------------------------------------------- 1 | # Computer Graphics Lab 2 | This repository contains Computer Graphics' Lab's programs as per the Autonomous curriculum of Dayananda Sagar College of Engineering. 3 | 4 | ## Getting Started 5 | Several options are available to get started: 6 | * Clone the repo at `git clone https://github.com/rishabhlakhotia/CSE-Lab-Manual` 7 | * Fork the repository if you think you can contribute back 8 | 9 | 10 | ## Contributing 11 | If you're having problems, or have a suggestion, please log and issue on GitHub. If you'd like to have a crack yourself, fork the repository and make a pull request. 12 | -------------------------------------------------------------------------------- /V Semester/Database-Management-System/Problem 3/query4.sql: -------------------------------------------------------------------------------- 1 | -- Produce a list of text books (include Course #, Book-ISBN, Book-title) in the alphabetical order for courses 2 | -- offered by the ‘CS’ department that use more than two books. 3 | 4 | SELECT C.course, T.bookisbn, T.booktitle 5 | FROM Course C, BookAdoption BA, Text T 6 | WHERE 7 | C.course = BA.course AND 8 | BA.bookisbn = T.bookisbn AND 9 | C.dept = 'CS' AND 10 | EXISTS ( 11 | SELECT * 12 | FROM BookAdoption BA1 13 | WHERE BA1.course = C.course 14 | GROUP BY BA1.course 15 | HAVING COUNT(BA1.course) > 2 16 | ) 17 | ORDER BY T.booktitle 18 | 19 | ; 20 | -------------------------------------------------------------------------------- /III Semester/OOPS-With-Java/11. Exception-Handling/a. Array-Out-Of-Bounds/ExceptionHandling.java: -------------------------------------------------------------------------------- 1 | public class ExceptionHandling { 2 | 3 | public static void main(String[]args){ 4 | 5 | int [] array = {4,8,15,16,23,42}; 6 | 7 | System.out.println("The lottery numbers are ..."); 8 | for(int i = 0; i <= array.length; i++) { 9 | // here, i<=array.length will be true, 10 | //even when i is equal to 6 which will 11 | //cause an ArrayIndexOutOfBoundsException 12 | 13 | System.out.println(".."+array[i]); 14 | 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /III Semester/OOPS-With-Java/3. Matrix-Multiplication/README.md: -------------------------------------------------------------------------------- 1 | ## Expected Output 2 | 3 | Enter the values of m and n 4 | 5 | 2 6 | 7 | 3 8 | 9 | Enter the values of p and q 10 | 11 | 3 12 | 13 | 2 14 | 15 | Enter the elements of Matrix A 16 | 17 | 1 18 | 19 | 2 20 | 21 | 3 22 | 23 | 4 24 | 25 | 5 26 | 27 | 6 28 | 29 | Enter the elements of Matrix B 30 | 31 | 1 32 | 33 | 2 34 | 35 | 3 36 | 37 | 4 38 | 39 | 5 40 | 41 | 6 42 | 43 | Contents of Matrix A 44 | 45 | 1 2 3 46 | 47 | 4 5 6 48 | 49 | Contents of Matrix B 50 | 51 | 1 2 52 | 53 | 3 4 54 | 55 | 5 6 56 | 57 | Contents of Matrix C 58 | 59 | 22 28 60 | 61 | 49 64 62 | -------------------------------------------------------------------------------- /III Semester/OOPS-With-Java/12. Threads/README.md: -------------------------------------------------------------------------------- 1 | ## Expected Output 2 | 3 | Good Morning 4 | 5 | Good Morning 6 | 7 | Hello 8 | 9 | Welcome 10 | 11 | Good Morning 12 | 13 | Hello 14 | 15 | Good Morning 16 | 17 | Good Morning 18 | 19 | Welcome 20 | 21 | Hello 22 | 23 | Good Morning 24 | 25 | Good Morning 26 | 27 | Hello 28 | 29 | Good Morning 30 | 31 | Welcome 32 | 33 | Good Morning 34 | 35 | Hello 36 | 37 | Good Morning 38 | 39 | Good Morning 40 | 41 | Welcome 42 | 43 | Hello 44 | 45 | Good Morning 46 | 47 | Good Morning 48 | 49 | Hello 50 | 51 | Good Morning 52 | 53 | Welcome 54 | 55 | Good Morning 56 | 57 | Hello 58 | 59 | Good Morning 60 | -------------------------------------------------------------------------------- /IV Semester/Microprocessor_and_Microcontroller_Lab/Extra/8255 Parity/prg.asm: -------------------------------------------------------------------------------- 1 | .MODELSMALL 2 | .DATA 3 | 4 | PA EQU 0D800H 5 | PB EQU 0D801H 6 | PC EQU 0D802H 7 | CW EQU 0D803H 8 | 9 | .CODE 10 | MOV AX,@DATA 11 | MOV DS,AX 12 | 13 | MOV AL,82H ;port B as input, rest(Port A) are outputs 14 | MOV DX,CW 15 | OUT DX,AL 16 | 17 | MOV DX,PB ;reading input form LCI 18 | IN AL,DX 19 | ADD AL,00H 20 | JPE evenP ;jump parity equal 21 | 22 | MOV AL,00H ;display '00' as odd parity on PA 23 | MOV DX,PA 24 | OUT DX,AL 25 | JMP EXIT 26 | 27 | evenP: 28 | MOV AL,0FFH ;display 'ff' as even parity PA 29 | MOV DX,PA 30 | OUT DX,AL 31 | 32 | EXIT: 33 | MOV AH,4CH 34 | INT 21H 35 | END 36 | -------------------------------------------------------------------------------- /V Semester/Database-Management-System/Problem 4/query3.sql: -------------------------------------------------------------------------------- 1 | -- Give the details of the authors who have 2 or more books in the catalog and the price of the books is greater 2 | -- than the average price of the books in the catalog and the year of publication is after 2000. 3 | 4 | SELECT * 5 | FROM Author A 6 | WHERE EXISTS ( 7 | SELECT A1.authorid, COUNT(A1.authorid) 8 | FROM Author A1, Catalog C 9 | WHERE 10 | A1.authorid = C.authorid AND 11 | A.authorid = A1.authorid AND 12 | C.yearofpublish > 2000 AND 13 | C.price > ( 14 | SELECT AVG(price) 15 | FROM Catalog 16 | ) 17 | GROUP BY A1.authorid 18 | HAVING COUNT(A1.authorid) >= 2 19 | ) 20 | ; 21 | 22 | -------------------------------------------------------------------------------- /IV Semester/Microprocessor_and_Microcontroller_Lab/Part-B/1_Largest_element_in_array.asm: -------------------------------------------------------------------------------- 1 | ;WRITE AN ASSEMBLY LANGUAGE PROGRAM TO FIND THE LARGEST ELEMENT IN A GIVEN ARRAY OF N =___ H BYTES AT LOCATION 4000H. STORE THE LARGEST ELEMENT AT LOCATION 4062H. 2 | 3 | ;Let N = 07h 4 | org 00h 5 | mov a,#0x05 6 | mov dptr,#0x4000 7 | mov r0,#0x07 8 | here: 9 | movx @dptr,a 10 | inc a 11 | inc dptr 12 | djnz r0,here 13 | mov r3,#07h 14 | mov dptr,#4000H 15 | movx a,@dptr 16 | mov r1,a 17 | nextbyte: inc dptr 18 | movx a,@dptr 19 | clr c 20 | mov r2,a 21 | subb a,r1 22 | jc skip 23 | mov a,r2 24 | mov r1,a 25 | skip: djnz r3,nextbyte 26 | mov dptr, #4062H 27 | mov a,r1 28 | movx @dptr,a 29 | end 30 | -------------------------------------------------------------------------------- /archives/VI Semester/Internet-and-Web-Technologies/2_Javascript/2b.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /I & II Semester/Programming-in-C/4. Bubble-Sort/BubbleSort.c: -------------------------------------------------------------------------------- 1 | #include 2 | void main(){ 3 | int a[100],n,i,j,temp; 4 | printf("Enter the number of elements\n"); 5 | scanf("%d",&n); 6 | printf("Enter the %d elements of array\n",n); 7 | for(int i=0;ia[j+1]){ 16 | temp=a[j]; 17 | a[j]=a[j+1]; 18 | a[j+1]=temp; 19 | } 20 | } 21 | } 22 | 23 | printf("The sorted array is\n"); 24 | for(int i=0;i 11 | 12 | ## Contributing 13 | If you're having problems, or have a suggestion, please log and issue on GitHub. If you'd like to have a crack yourself, fork the repository and make a pull request. 14 | -------------------------------------------------------------------------------- /I & II Semester/Programming-in-C/4. Bubble-Sort/README.md: -------------------------------------------------------------------------------- 1 | # Expected Output 2 | 3 | Run 1: 4 | 5 | Enter the number of elements 6 | 7 | 4 8 | 9 | Enter the 4 elements of array 10 | 11 | 3 86 103 54 12 | 13 | The Input array is 14 | 15 | 3 16 | 17 | 86 18 | 19 | 103 20 | 21 | 54 22 | 23 | The sorted array is 24 | 25 | 3 26 | 27 | 54 28 | 29 | 86 30 | 31 | 103 32 | 33 | 34 | 35 | 36 | 37 | Run 2: 38 | 39 | Enter the number of elements 40 | 41 | 5 42 | 43 | Enter the 5 elements of array 44 | 45 | 76 12 45 22 90 46 | 47 | The Input array is 48 | 49 | 76 50 | 51 | 12 52 | 53 | 45 54 | 55 | 22 56 | 57 | 90 58 | 59 | The sorted array is 60 | 61 | 12 62 | 63 | 22 64 | 65 | 45 66 | 67 | 76 68 | 69 | 90 70 | -------------------------------------------------------------------------------- /III Semester/OOPS-With-Java/10. String Operations/a. Middle-Character/Middle.java: -------------------------------------------------------------------------------- 1 | import java.util.Scanner; 2 | 3 | public class Middle { 4 | public static void main (String args []) { 5 | Scanner in = new Scanner(System.in); 6 | System.out.println("Enter word: "); 7 | String str = in.next(); 8 | System.out.println("Middle = " + middle(str)); 9 | } //end main 10 | 11 | public static String middle(String str) 12 | { 13 | if ((str.length() % 2) == 0) 14 | { 15 | if (str.length() > 2) { 16 | return str.substring(str.length()/2 - 1, str.length()/2 + 1); 17 | } 18 | else { 19 | return str; 20 | } 21 | } 22 | else {return str.substring(str.length()/2,str.length()/2+1);} 23 | } // end middle 24 | } 25 | -------------------------------------------------------------------------------- /I & II Semester/Programming-in-C/5. Binary-Search/BinarySearch.c: -------------------------------------------------------------------------------- 1 | #include 2 | void main(){ 3 | int a[100],n,i,key,low,mid,high,found=0; 4 | printf("Enter the number of elements\n"); 5 | scanf("%d",&n); 6 | printf("Enter %d elements in ascending order\n",n); 7 | for(i=0;i 2 | int isprime(int);//functon prototype 3 | void main(){ 4 | int n1,n2,r,i; 5 | printf("Enter the range n1 and n2 to find prime numbers\n"); 6 | scanf("%d%d",&n1,&n2);//read the inputs 7 | printf("The prime numbers between %d and %d are\n",n1,n2); 8 | for(i=n1;i<=n2;i++){ 9 | 10 | r=isprime(i);//functon call 11 | if(r==1){ 12 | printf("%d\t",i); 13 | } 14 | } 15 | } 16 | int isprime(int x){ 17 | int i,c=0; 18 | for(i=1;i<=x;i++){ 19 | if(x%i==0){//check if number is completely divisible 20 | c++; 21 | } 22 | } 23 | if(c==2)//check if number is divisible by 1 and itself 24 | return (1); 25 | else 26 | return (0); 27 | } 28 | -------------------------------------------------------------------------------- /IV Semester/Microprocessor_and_Microcontroller_Lab/Part-B/2_Add_Sub_16_Bit.asm: -------------------------------------------------------------------------------- 1 | ;WRITE AN ASSEMBLY LANGUAGE PROGRAM TO PERFORM THE ADDITION AND SUBTRACTION OF TWO 16-BIT NUMBERS. 2 | 3 | ;ADDITION 4 | mov r0,#43h //lower nibble of No.1 5 | mov r1,#21h //higher nibble of No.1 6 | mov r2,#0cdh //lower nibble of No.2 7 | mov r3,#0efh //higher nibble of No.2 8 | clr c 9 | mov a,r0 10 | add a,r2 11 | mov 22h,a 12 | mov a,r1 13 | addc a,r3 14 | mov 21h,a 15 | mov 00h,c 16 | 17 | ;SUBTRACTION 18 | mov r0,#0cdh //lower nibble of No.1 19 | mov r1,#0efh //higher nibble of No.1 20 | mov r2,#43h //lower nibble of No.2 21 | mov r3,#21h //higher nibble of No.2 22 | clr c 23 | mov a,r0 24 | subb a,r2 25 | mov 32h,a 26 | mov a,r1 27 | subb a,r3 28 | mov 31h,a 29 | mov 00h,c 30 | end 31 | 32 | -------------------------------------------------------------------------------- /I & II Semester/Programming-in-C/10. Standard-Deviation/StandardDeviation.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | void main() { 5 | 6 | //Declare Variables 7 | float a[10],*ptr,mean=0,sum=0,sd=0,sumsd=0; 8 | int i,n; 9 | 10 | //Taking inputs 11 | printf("\nEnter the number of element\n"); 12 | scanf("%d",&n); 13 | printf("\nEnter the elements:\n"); 14 | for(i=0;i= 0; i--) 14 | reverse = reverse + original.charAt(i); 15 | 16 | if (original.equals(reverse)) 17 | System.out.println("Entered string is a palindrome."); 18 | else 19 | System.out.println("Entered string is not a palindrome."); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /IV Semester/ADA_Lab/4_Floyd_Warshal/FLOYD.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int i,j,k,n,a[50][50]; 5 | 6 | void Floyd( int a[50][50],int n){ 7 | 8 | for(k=1;k<=n;k++){ 9 | for(i=1;i<=n;i++){ 10 | for(j=1;j<=n;j++){ 11 | if(a[i][j]>a[i][k]+a[k][j]) 12 | a[i][j]= a[i][k]+a[k][j]; 13 | 14 | } 15 | } 16 | } 17 | 18 | printf("the modified mtrix is\n"); 19 | for(i=1;i<=n;i++){ 20 | for(j=1;j<=n;j++){ 21 | printf("%d\t",a[i][j]); 22 | } 23 | printf("\n"); 24 | } 25 | } 26 | 27 | int main(){ 28 | 29 | printf("enter the no. of nodes\n"); 30 | scanf("%d",&n); 31 | printf("Enter the cost matrix\n"); 32 | for(i=1;i<=n;i++) 33 | for(j=1;j<=n;j++){ 34 | scanf("%d",&a[i][j]); 35 | } 36 | 37 | Floyd(a,n); 38 | return 0; 39 | } 40 | -------------------------------------------------------------------------------- /IV Semester/ADA_Lab/4_Floyd_Warshal/WARSHALL.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int i,j,k,n,a[50][50]; 5 | 6 | void Warshall( int a[50][50],int n){ 7 | 8 | for(k=1;k<=n;k++){ 9 | for(i=1;i<=n;i++){ 10 | for(j=1;j<=n;j++){ 11 | if((a[i][j]==0)&&(a[i][k]==1 && a[k][j]==1)) 12 | a[i][j]=1; 13 | 14 | } 15 | } 16 | } 17 | 18 | printf("the modified matrix is\n"); 19 | for(i=1;i<=n;i++){ 20 | for(j=1;j<=n;j++){ 21 | printf("%d\t",a[i][j]); 22 | } 23 | printf("\n"); 24 | } 25 | } 26 | 27 | int main(){ 28 | printf("enter the no. of nodes\n"); 29 | scanf("%d",&n); 30 | printf("Enter the adjacency matrix\n"); 31 | for(i=1;i<=n;i++) 32 | for(j=1;j<=n;j++){ 33 | scanf("%d",&a[i][j]); 34 | } 35 | 36 | Warshall(a,n); 37 | return 0; 38 | } 39 | -------------------------------------------------------------------------------- /archives/VI Semester/Internet-and-Web-Technologies/README.md: -------------------------------------------------------------------------------- 1 | # Internet and Web Technologies 2 | This repository contains all the IWT Lab's program in the Autonomous curriculum of Dayananda Sagar College of Engineering. 3 | 4 | ## Getting Started 5 | Several options are available to get started: 6 | * Clone the repo at `git clone https://github.com/rishabhlakhotia/CSE-Lab-Manual` 7 | * Fork the repository if you think you can contribute back 8 | 9 | ## Source 10 | All the codes in this repo are inspired from the Autonomous curriculum of Dayananda Sagar College of Engineering of Data Structures in C and OOPS with Java Labs. 11 | 12 | ## Contributing 13 | If you're having problems, or have a suggestion, please log and issue on GitHub. If you'd like to have a crack yourself, fork the repository and make a pull request. 14 | -------------------------------------------------------------------------------- /IV Semester/README.md: -------------------------------------------------------------------------------- 1 | # Design and Analysis of Algorithm Lab 2 | This repository contains Design and Analysis of Algorithm's Lab's program in the Autonomous curriculum of Dayananda Sagar College of Engineering. 3 | 4 | # Microprocessor and Microcontroller Lab 5 | This repository contains all the Microprocessor and Microcontroller Lab's program in the Autonomous curriculum of Dayananda Sagar College of Engineering. 6 | 7 | ## Getting Started 8 | Several options are available to get started: 9 | * Clone the repo at `git clone https://github.com/rishabhlakhotia/CSE-Lab-Manual` 10 | * Fork the repository if you think you can contribute back 11 | 12 | ## Contributing 13 | If you're having problems, or have a suggestion, please log and issue on GitHub. If you'd like to have a crack yourself, fork the repository and make a pull request. 14 | -------------------------------------------------------------------------------- /VI Semester/README.md: -------------------------------------------------------------------------------- 1 | # System Software and Operating System 2 | This repository contains all the System Software and Operating System Lab's programs in the Autonomous curriculum of Dayananda Sagar College of Engineering. 3 | 4 | ## Getting Started 5 | Several options are available to get started: 6 | * Clone the repo at `git clone https://github.com/rishabhlakhotia/CSE-Lab-Manual` 7 | * Fork the repository if you think you can contribute back 8 | 9 | ## Source 10 | All the codes in this repo are inspired from the Autonomous curriculum of Dayananda Sagar College of Engineering of Data Structures in C and OOPS with Java Labs. 11 | 12 | ## Contributing 13 | If you're having problems, or have a suggestion, please log and issue on GitHub. If you'd like to have a crack yourself, fork the repository and make a pull request. 14 | -------------------------------------------------------------------------------- /IV Semester/Microprocessor_and_Microcontroller_Lab/Extra/8255 Generate_Half_Full_Wave/prg.asm: -------------------------------------------------------------------------------- 1 | .MODEL SMALL 2 | .DATA 3 | ;((2.25/2) + sin(Theta))*100 4 | ;where v ref is 2.25 5 | TABLE DB 127,144,161,177,191,204,214,225,227,225,221,214,204,191,177,161,144,127d,127d,127d,127d,127d,127d,127d,127d,127d,127d,127d,127d,127d,127d,127d,127d,127d,127d,127d 6 | ;half wave 7 | PA EQU 0D800H 8 | PB EQU 0D801H 9 | PC EQU 0D802H 10 | CW EQU 0D803H 11 | 12 | .CODE 13 | MOV AX,@DATA 14 | MOV DS,AX 15 | 16 | MOV DX,CW 17 | MOV AL,80H ;all are output ports 18 | OUT DX,AL 19 | 20 | L2: 21 | MOV CX,37D ;loop for 27 times i.e one full wave 22 | MOV DX,PA 23 | LEA SI,TABLE ;out the table values through port A 24 | 25 | L1: 26 | MOV AL,[SI] 27 | OUT DX,AL 28 | INC SI 29 | LOOP L1 30 | 31 | JMP L2 32 | 33 | MOV AH, 4CH 34 | INT 21H 35 | 36 | END 37 | -------------------------------------------------------------------------------- /I & II Semester/Programming-in-C/7. String-Concat/READEME.md: -------------------------------------------------------------------------------- 1 | # Expected Output 2 | 3 | Run 1: 4 | 5 | Enter the String 1 6 | 7 | Dayananda 8 | 9 | Enter the String 2 10 | 11 | Sagar 12 | 13 | 14 | 15 | String STR1= Dayananda 16 | 17 | 18 | 19 | String STR2= Sagar 20 | 21 | 22 | 23 | String STR3= Dayananda Sagar 24 | 25 | 26 | 27 | 28 | 29 | Run 2: 30 | 31 | Enter the String 1 32 | 33 | CSE 34 | 35 | Enter the String 2 36 | 37 | DEPARTMENT 38 | 39 | 40 | 41 | String STR1= CSE 42 | 43 | 44 | 45 | String STR2= DEPARTMENT 46 | 47 | 48 | 49 | String STR3= CSE DEPARTMENT 50 | 51 | 52 | 53 | RUN 3: 54 | 55 | Enter the String 1 56 | 57 | PIXLEYES 58 | 59 | Enter the String 2 60 | 61 | @DSCE 62 | 63 | 64 | 65 | String STR1= PIXLEYES 66 | 67 | 68 | 69 | String STR2= @DSCE 70 | 71 | 72 | 73 | String STR3= PIXLEYES @DSCE 74 | -------------------------------------------------------------------------------- /IV Semester/ADA_Lab/11_Nqueen/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | void nqueen(int); 4 | int place(int [],int); 5 | void main() 6 | { 7 | int n; 8 | printf("enter n\n"); 9 | scanf("%d",&n); 10 | nqueen(n); 11 | } 12 | void nqueen(int n) 13 | { 14 | int k=1,x[100],count=0,i; 15 | x[k]=0; 16 | while(k!=0) 17 | { 18 | x[k]+=1; 19 | while((x[k]<=n) && (place(x,k)==0)) 20 | x[k]+=1; 21 | if(x[k]<=n) 22 | { 23 | if(k==n) 24 | { 25 | printf("solution no %d\n",count++); 26 | for(i=1;i<=n;i++) 27 | printf("%d ",x[i]); 28 | getch(); 29 | } 30 | else 31 | { 32 | k++; 33 | x[k]=0; 34 | } 35 | } 36 | k--; 37 | } 38 | } 39 | int place(int x[100],int k) 40 | { 41 | int i; 42 | for(i=1;i<=k-1;i++) 43 | { 44 | if(x[i]==x[k]) 45 | return 0; 46 | if(abs(i-k)==abs(x[i]-x[k])) 47 | return 0; 48 | } 49 | return 1; 50 | } 51 | -------------------------------------------------------------------------------- /I & II Semester/Programming-in-C/2. Quadratic-Equation/QuadraticEquation.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | void main(){ 4 | float a,b,c,r1,r2,d,rpart,ipart; 5 | printf("Enter the non zero coefficient values of a,b and c: "); 6 | scanf("%d%d%d",&a,&b,&c); 7 | d=(b*b)-(4*a*c); 8 | if(d==0){ 9 | printf("\nThe roots are real and equal"); 10 | r1=-b/(2*a); 11 | r2=r1; 12 | printf("\nRoot1=%f\tRoot2=%f",r1,r2); 13 | } 14 | else if(d>0){ 15 | printf("\nThe roots are real and distinct"); 16 | r1=((-b)+sqrt(d))/(2*a); 17 | r1=((-b)-sqrt(d))/(2*a); 18 | printf("Root1=%f\nRoot2=%f",r1,r2); 19 | } 20 | else{ 21 | printf("The roots are imaginary\n"); 22 | rpart=-b/(2*a); 23 | ipart=sqrt(fabs(d))/(2*a); 24 | printf("Root1=%f+i%f\n",rpart,ipart); 25 | printf("Root1=%f-i%f\n",rpart,ipart); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /IV Semester/ADA_Lab/3_BFS_DFS/DFS.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | void DFS(int n,int a[10][10],int src,int s[10]) 5 | { 6 | 7 | int i; 8 | s[src]=1; 9 | printf("%d=>",src); 10 | for(i=1;i<=n;i++){ 11 | if(s[i]==0 && a[src][i]==1) 12 | DFS(n,a,i,s); 13 | } 14 | } 15 | 16 | int main() 17 | { 18 | int src,n,i,j,s[10],a[10][10]; 19 | 20 | 21 | printf("Enter the no. of nodes\n"); 22 | scanf("%d",&n); 23 | 24 | for(i=1;i<=n;i++) 25 | s[i]=0; 26 | 27 | 28 | printf("Enter the adjacency matrix\n"); 29 | for(i=1;i<=n;i++) 30 | for(j=1;j<=n;j++) 31 | scanf("%d",&a[i][j]); 32 | 33 | printf("Enter the source node\n"); 34 | scanf("%d",&src); 35 | 36 | printf("The DFS tarversal is:\n"); 37 | DFS(n,a,src,s); 38 | 39 | printf("The reached nodes are:\n"); 40 | for(i=1;i<=n;i++) 41 | if(s[i]==1) 42 | printf("%d\t",i); 43 | 44 | return 0; 45 | 46 | } 47 | -------------------------------------------------------------------------------- /III Semester/OOPS-With-Java/8. Read-Write-File/BRRead.java: -------------------------------------------------------------------------------- 1 | import java.io.*; 2 | class BRRead { 3 | public static void main(String args[]) throws IOException 4 | { 5 | char c; 6 | int i; 7 | FileOutputStream fout = new FileOutputStream(args[0]); 8 | BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); 9 | System.out.println("Enter characters, 'q' to quit."); 10 | // read characters from console and write to file 11 | do { 12 | c = (char) br.read(); 13 | if(c!='q') fout.write(c); 14 | } while(c!='q'); 15 | fout.close(); 16 | System.out.println("**** Lets display the contents of the file ****"); 17 | 18 | //read characters from the file and write back to console 19 | FileInputStream fin = new FileInputStream(args[0]); 20 | do { 21 | i = fin.read(); 22 | if(i != -1) System.out.print((char) i); 23 | } while(i != -1); 24 | fin.close(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /IV Semester/Microprocessor_and_Microcontroller_Lab/Extra/8255 BCD_Up_Down_Counter/prg.asm: -------------------------------------------------------------------------------- 1 | .MODEL SMALL 2 | .DATA 3 | 4 | PA EQU 0D800H 5 | PB EQU 0D801H 6 | PC EQU 0D802H 7 | CW EQU 0D803H 8 | 9 | .CODE 10 | MOV AX,@DATA 11 | MOV DS,AX 12 | 13 | MOV DX,CW 14 | MOV AL,80H ;all ports are outputs 15 | OUT DX,AL 16 | 17 | MOV DX,PA ;port A as output for bcd 18 | MOV AL,00H ;initial value 0 19 | 20 | UP: 21 | OUT DX,AL ;Display BCD 22 | CALL DELAY 23 | INC AL 24 | DAA ;Decimal Adjust after Addition 25 | CMP AL,00H 26 | JNZ UP 27 | 28 | MOV AL,98d 29 | 30 | DOWN: 31 | OUT DX,AL ;Display BCD 32 | CALL DELAY 33 | DEC AL 34 | DAS ;Decimal Adjust after Subtraction 35 | CMP AL,99d 36 | JNZ DOWN 37 | 38 | MOV AH,4CH 39 | INT 21H 40 | 41 | DELAY PROC NEAR 42 | MOV SI,0FFFFH 43 | Outer: 44 | MOV DI,0FFFFH 45 | Inner: 46 | DEC DI 47 | JNZ Inner 48 | DEC SI 49 | JNZ Outer 50 | RET 51 | DELAY ENDP 52 | 53 | END 54 | -------------------------------------------------------------------------------- /I & II Semester/Programming-in-C/7. String-Concat/Concat.c: -------------------------------------------------------------------------------- 1 | #include 2 | void main(){ 3 | char STR1[100],STR2[100],STR3[100]; 4 | int i=0,j=0,count=0; 5 | 6 | //READING STR1 AND STR2 7 | printf("Enter the String 1\n"); 8 | gets(STR1); 9 | printf("Enter the String 2\n"); 10 | gets(STR2); 11 | 12 | //COPY STR1 TO STR3 13 | while(STR1[i]!='\0'){ 14 | STR3[count]=STR1[i]; 15 | i++; 16 | count++; 17 | } 18 | //INSERT BLANK SPACE BETWEEN STR1 AND STR2 19 | STR3[count++]=' '; 20 | 21 | //COPY STRING STR2 TO STR3 FROM THE LOCATION count 22 | while(STR2[j]!='\0'){ 23 | STR3[count]=STR2[j]; 24 | count++; 25 | j++; 26 | } 27 | //END OF String 28 | STR3[count]='\0'; 29 | //PRINTING OF STRINGS STR1,STR2,STR3 30 | printf("\nString STR1=\t"); 31 | puts(STR1); 32 | printf("\nString STR2=\t"); 33 | puts(STR2); 34 | printf("\nString STR3=\t"); 35 | puts(STR3); 36 | 37 | } 38 | -------------------------------------------------------------------------------- /III Semester/README.md: -------------------------------------------------------------------------------- 1 | # Data-Structure-in-C-Lab 2 | This repository contains all the Data structure in C Lab's program in the Autonomous curriculum of Dayananda Sagar College of Engineering. 3 | 4 | # OOPS-With-Java-Lab 5 | This repository contains all the OOPS With Java Lab's program in the Autonomous curriculum of Dayananda Sagar College of Engineering. 6 | 7 | ## Getting Started 8 | Several options are available to get started: 9 | * Clone the repo at `git clone https://github.com/rishabhlakhotia/CSE-Lab-Manual` 10 | * Fork the repository if you think you can contribute back 11 | 12 | ## Source 13 | All the codes in this repo are inspired from the Autonomous curriculum of Dayananda Sagar College of Engineering of Data Structures in C and OOPS with Java Labs. 14 | 15 | ## Contributing 16 | If you're having problems, or have a suggestion, please log and issue on GitHub. If you'd like to have a crack yourself, fork the repository and make a pull request. 17 | -------------------------------------------------------------------------------- /IV Semester/ADA_Lab/9_Dijkstra/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | void dijk(int cost[10][10],int n,int v[10],int d[10],int source) 4 | { 5 | int i,j,min,u; 6 | v[source]=1; 7 | for(i=0;id[u]+cost[u][j]) 22 | d[j]=d[u]+cost[u][j]; 23 | } 24 | } 25 | } 26 | void main() 27 | { 28 | int i,j,n,source,cost[10][10],v[10],d[10]; 29 | printf("enter n \n"); 30 | scanf("%d",&n); 31 | printf("enter cost matrix\n"); 32 | for(i=0;i%d===%d\n",source,i,d[i]); 45 | getch(); 46 | } 47 | -------------------------------------------------------------------------------- /V Semester/README.md: -------------------------------------------------------------------------------- 1 | # Computer-Networks 2 | This repository contains the C programs of the Computer Networks Lab in the Autonomous curriculum of Dayananda Sagar College of Engineering. 3 | 4 | # Database-Management-System 5 | This repository contains all the Database Management System Lab's program in the Autonomous curriculum of Dayananda Sagar College of Engineering. 6 | 7 | ## Getting Started 8 | Several options are available to get started: 9 | * Clone the repo at `git clone https://github.com/rishabhlakhotia/CSE-Lab-Manual` 10 | * Fork the repository if you think you can contribute back 11 | 12 | ## Source 13 | All the codes in this repo are inspired from the Autonomous curriculum of Dayananda Sagar College of Engineering of Data Structures in C and OOPS with Java Labs. 14 | 15 | ## Contributing 16 | If you're having problems, or have a suggestion, please log and issue on GitHub. If you'd like to have a crack yourself, fork the repository and make a pull request. 17 | -------------------------------------------------------------------------------- /V Semester/Database-Management-System/Problem 1/create_tables.sql: -------------------------------------------------------------------------------- 1 | -- Creating Student table 2 | 3 | CREATE TABLE Student ( 4 | snum INT, 5 | sname VARCHAR(15), 6 | major VARCHAR(15), 7 | slevel VARCHAR(15), 8 | age INT, 9 | PRIMARY KEY (snum) 10 | ); 11 | 12 | DESC Student; 13 | 14 | 15 | -- Creating Faculty table 16 | 17 | CREATE TABLE Faculty ( 18 | fid INT, 19 | fname VARCHAR(15), 20 | deptid INT, 21 | PRIMARY KEY (fid) 22 | ); 23 | 24 | DESC Faculty; 25 | 26 | 27 | -- Creating Class table 28 | 29 | CREATE TABLE Class ( 30 | cname VARCHAR(15), 31 | meets_at VARCHAR(15), 32 | room VARCHAR(15), 33 | fid INT, 34 | PRIMARY KEY (cname), 35 | FOREIGN KEY (fid) REFERENCES Faculty (fid) 36 | ); 37 | 38 | DESC Class; 39 | 40 | 41 | -- Creating Enrolled table 42 | 43 | CREATE TABLE Enrolled ( 44 | snum INT, 45 | cname VARCHAR(15), 46 | FOREIGN KEY (snum) REFERENCES Student (snum), 47 | FOREIGN KEY (cname) REFERENCES Class (cname) 48 | ); 49 | 50 | DESC Enrolled; 51 | 52 | -------------------------------------------------------------------------------- /V Semester/Database-Management-System/Problem 2/create_tables.sql: -------------------------------------------------------------------------------- 1 | -- Creating Flights table 2 | 3 | CREATE TABLE Flights ( 4 | flno INT, 5 | ffrom VARCHAR(15), 6 | tto VARCHAR(15), 7 | distance INTEGER, 8 | departs TIMESTAMP, 9 | arrives TIMESTAMP, 10 | price REAL, 11 | PRIMARY KEY (flno) 12 | ); 13 | 14 | DESC Flights; 15 | 16 | 17 | -- Creating Aircraft table 18 | 19 | CREATE TABLE Aircraft ( 20 | aid INT, 21 | aname VARCHAR(15), 22 | cruisingrange INT, 23 | PRIMARY KEY (aid) 24 | ); 25 | 26 | DESC Aircraft; 27 | 28 | 29 | -- Creating Employees table 30 | 31 | CREATE TABLE Employees ( 32 | eid INT, 33 | ename VARCHAR(15), 34 | salary REAL, 35 | PRIMARY KEY (eid) 36 | ); 37 | 38 | DESC Employees; 39 | 40 | 41 | -- Creating Certified table 42 | 43 | CREATE TABLE Certified ( 44 | eid INT, 45 | aid INT, 46 | PRIMARY KEY (eid, aid), 47 | FOREIGN KEY (eid) REFERENCES Employees (eid), 48 | FOREIGN KEY (aid) REFERENCES Aircraft (aid) 49 | ); 50 | 51 | DESC Certified; 52 | 53 | -------------------------------------------------------------------------------- /archives/VI Semester/README.md: -------------------------------------------------------------------------------- 1 | # Internet and Web Technologies 2 | This repository contains all the IWT Lab's program in the Autonomous curriculum of Dayananda Sagar College of Engineering. 3 | 4 | # Computer-Graphics-and-Visualization 5 | This repository contains the programs of the Computer Graphics and Visualization Lab in the Autonomous curriculum of Dayananda Sagar College of Engineering. 6 | 7 | ## Getting Started 8 | Several options are available to get started: 9 | * Clone the repo at `git clone https://github.com/rishabhlakhotia/CSE-Lab-Manual` 10 | * Fork the repository if you think you can contribute back 11 | 12 | ## Source 13 | All the codes in this repo are inspired from the Autonomous curriculum of Dayananda Sagar College of Engineering of Data Structures in C and OOPS with Java Labs. 14 | 15 | ## Contributing 16 | If you're having problems, or have a suggestion, please log and issue on GitHub. If you'd like to have a crack yourself, fork the repository and make a pull request. 17 | -------------------------------------------------------------------------------- /IV Semester/ADA_Lab/10_Sum_of_Subset/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | int count; //to count no of solutions 4 | int w[10]; //items 5 | int m; //required sum 6 | int x[10]; //items whose sum is d 7 | void subset(int wsf,int k,int trm) 8 | { 9 | int i; 10 | x[k]=1; 11 | if(wsf+w[k]==m) 12 | { 13 | printf("\n subset solution%d\n",count++); 14 | for(i=0;i<=k;i++) 15 | { 16 | if(x[i]==1) 17 | printf("%d",w[i]); 18 | } 19 | return; 20 | } 21 | if(wsf+w[k]+w[k+1]<=m) 22 | subset(wsf+w[k],k+1,trm-w[k]); 23 | if((wsf+trm-w[k]>=m) && (wsf+w[k+1]<=m)) 24 | { 25 | x[k]=0; 26 | subset(wsf,k+1,trm-w[k]); 27 | } 28 | } 29 | void main() 30 | { 31 | int sum=0; 32 | int i,n; 33 | printf("enter n\n"); 34 | scanf("%d",&n); 35 | printf("enter items in increasing order\n"); 36 | for(i=0;i 2 | #include 3 | int partition(int a[],int start,int end) 4 | { 5 | int i,temp; 6 | int pivot=a[end]; 7 | int pindex=start; 8 | for(i=start;i 2 | #include 3 | void merge(int a[],int low,int mid,int high) 4 | { 5 | int i=low,j=mid+1,k=low,c[100]; 6 | while(i<=mid && j<=high) 7 | { 8 | if(a[i] 2 | 4 | 5 | 6 | 7 | 8 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /VI Semester/System-Software-and-Operating-System/9A-Race-Condition/9a.c: -------------------------------------------------------------------------------- 1 | /* Write a C/C++ program to illustrate the race condition. 2 | */ 3 | 4 | #include 5 | #include 6 | #include 7 | static void charatatime (char *); 8 | 9 | int main (void) 10 | { 11 | pid_t pid; 12 | if ((pid=fork( ))< 0) 13 | { 14 | printf("fork error\n"); 15 | } 16 | else if(pid==0) 17 | { 18 | charatatime("Output from child\n"); 19 | } 20 | else 21 | { 22 | charatatime("Output from parent\n"); 23 | } 24 | exit(0); 25 | } 26 | 27 | static void charatatime(char *str) 28 | { 29 | char *ptr; 30 | int c; 31 | setbuf(stdout,NULL); /* set unbuffered*/ 32 | for(ptr=str;(c=*ptr++)!=0;) 33 | putc(c,stdout); 34 | } 35 | 36 | /* 37 | ************************** 38 | Program output: 39 | [root@localhost ~]# vim 9a.c 40 | [root@localhost ~]# cc 9a.c 41 | [root@localhost ~]# ./a.out 42 | Output from childOutput from parent 43 | */ -------------------------------------------------------------------------------- /III Semester/Data-Structure-in-C/1. Best_of_two/BESTTWO.C: -------------------------------------------------------------------------------- 1 | // Program to get the average of two largest numbers 2 | #include 3 | #include 4 | 5 | void main() { 6 | int a[100], n, i, l1, l2 = -999; 7 | float avg; 8 | 9 | clrscr(); 10 | printf("Enter the number of elements\n"); 11 | scanf("%d", &n); 12 | 13 | // Retrieving array 14 | printf("\nEnter %d elements: ", n); 15 | for (i = 0; i < n; i++) { 16 | scanf("%d", &a[i]); 17 | } 18 | l1 = a[0]; 19 | 20 | // Checking for largest and second largest numbers 21 | for (i = 1; i < n; i++) { 22 | if (a[i] > l1) 23 | l1 = a[i]; 24 | } 25 | 26 | l2 = a[0]; 27 | for (i = 1; i < n; i++) { 28 | if (a[i] > l2 && l1 != a[i]) 29 | l2 = a[i]; 30 | } 31 | 32 | // Calculating average and printing it 33 | printf("Largest Number is: %d\nSecond largest Number is: %d", l1, l2); 34 | avg = (float)(l1 + l2) / 2; 35 | printf("\nAverage of Best two Number is: %f", avg); 36 | getch(); 37 | 38 | } 39 | -------------------------------------------------------------------------------- /IV Semester/Microprocessor_and_Microcontroller_Lab/Extra/8086 Move_Cursor/prg.asm: -------------------------------------------------------------------------------- 1 | .model small 2 | 3 | .data 4 | x db 00h 5 | y db 00h 6 | m1 db 10,13,'enter the x coordinate : $' 7 | m2 db 10,13,'enter the y coordinate : $' 8 | m3 db 'cursor $' 9 | 10 | .code 11 | mov ax,@data 12 | mov ds,ax 13 | 14 | mov ax,00h 15 | lea dx,m1 16 | mov ah,09h 17 | int 21h 18 | 19 | call read ;reading x coordinate 20 | mov x,al 21 | lea dx,m2 22 | mov ah,09h 23 | int 21h 24 | 25 | call read ;reading y coordinate 26 | mov y,al 27 | 28 | mov ah,06h ;clearing the screen 29 | mov cx,0000h 30 | mov bh,07h 31 | mov dx,2479d 32 | int 10h 33 | 34 | mov ah,02h ; setting the cursor at the specified location 35 | mov bh,00h 36 | mov dh,x 37 | mov dl,y 38 | int 10h 39 | lea dx,m3 40 | mov ah,09h 41 | int 21h 42 | mov ah,4ch 43 | int 21h 44 | 45 | read proc near 46 | mov ah,01h 47 | int 21h 48 | sub al,30h 49 | mov bl,al 50 | mov ah,01h 51 | int 21h 52 | sub al,30h 53 | mov ah,bl 54 | aad 55 | ret 56 | read endp 57 | 58 | end 59 | -------------------------------------------------------------------------------- /V Semester/Database-Management-System/README.md: -------------------------------------------------------------------------------- 1 | # Database Management System Lab 2 | This repository contains Database Management Lab's program in the Autonomous curriculum of Dayananda Sagar College of Engineering. 3 | 4 | ## Getting Started 5 | Several options are available to get started: 6 | * Clone the repo at `git clone https://github.com/rishabhlakhotia/CSE-Lab-Manual` 7 | * Fork the repository if you think you can contribute back 8 | 9 | ## How to work with DBMS 10 | 1. Create a Database 11 | `mysql> CREATE DATABASE Test; 12 | mysql> USE Test;` 13 | 14 | 2. Create table 15 | `mysql> SOURCE /dbms/problem/create_tables.sql` 16 | Use only absolute path 17 | 18 | 3. Fill table 19 | `mysql> SOURCE /dbms/problem/fill_tables.sql` 20 | Use only absolute path 21 | 22 | 4. Run queries 23 | `mysql> SOURCE /dbms/problem/query.sql` 24 | Use only absolute path 25 | 26 | ## Contributing 27 | If you're having problems, or have a suggestion, please log and issue on GitHub. If you'd like to have a crack yourself, fork the repository and make a pull request. 28 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to CSE Lab Manual 2 | 3 | :+1::tada: First off, thanks for taking the time to contribute! :tada::+1: 4 | 5 | When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change. 6 | 7 | ### Cloning the repository 8 | * Fork the repository 9 | * Clone the repo by running `git clone https://github.com//CSE-Lab-Manual` 10 | 11 | ### Pull Request Process 12 | 1. Ensure that you have changed all the programs related to one lab. A lab should not be a mix of new and old programs. 13 | 1. Update the README.md respective to the lab with details of changes to the programs, including any special, unhandled cases encountered during the process of updating. Also update hyperlinks as required. 14 | 1. Do not delete the old programs. Instead, move them to the [archives](/archives) directory in suitable sub-directory. 15 | 1. Do not deviate from the directory structure and maintain the same structure and file-naming method throughout the repository. 16 | -------------------------------------------------------------------------------- /IV Semester/ADA_Lab/3_BFS_DFS/BFS.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | void BFS(int n,int graph[10][10], int source, int s[10]) 5 | { 6 | int i,f=0,r=-1,q[10],v; 7 | 8 | printf("%d",source); 9 | //assigning 1 as visted else default 0 10 | s[source] = 1; 11 | q[++r] = source; 12 | 13 | while(f <= r) 14 | { 15 | v = q[f++]; 16 | for(i = 1; i<=n; i++) 17 | { 18 | if(s[i] ==0 && graph[v][i]) 19 | { 20 | q[++r] = i; 21 | printf("-->%d",i); 22 | s[i] = 1; 23 | } 24 | } 25 | } 26 | } 27 | void main() 28 | { 29 | int n,i,j,source,graph[10][10],s[10]; 30 | 31 | 32 | printf("Enter Number of nodes: "); 33 | scanf("%d",&n); 34 | 35 | for(i=1;i<=n;i++) 36 | s[i] = 0; 37 | 38 | printf("Enter source node: "); 39 | scanf("%d",&source); 40 | 41 | printf("Enter Graph Matrix: \n"); 42 | for(i=1; i<=n; i++) 43 | for(j=1; j<=n; j++) 44 | scanf("%d",&graph[i][j]); 45 | 46 | printf("Traversal is : "); 47 | BFS(n,graph,source,s); 48 | 49 | printf("\nreached nodes: "); 50 | for(i=1;i<=n; i++) 51 | if(s[i] == 1) 52 | printf("%d, ",i); 53 | } 54 | -------------------------------------------------------------------------------- /IV Semester/Microprocessor_and_Microcontroller_Lab/Part-A/1B_Display_XxY/1B.asm: -------------------------------------------------------------------------------- 1 | .MODEL SMALL 2 | PRINTF MACRO MSG 3 | LEA DX,MSG 4 | MOV AH,09H 5 | INT 21H 6 | ENDM 7 | 8 | .DATA 9 | PA EQU 0D800H 10 | PB EQU 0D801H 11 | PC EQU 0D802H 12 | CW EQU 0D803H 13 | 14 | M1 DB 10,13,'Enter 1st 8 bit Number: $' 15 | M2 DB 10,13,'Enter 2nd 8 bit Number: $' 16 | 17 | .CODE 18 | MOV AX,@DATA 19 | MOV DS,AX 20 | 21 | MOV AL,82H ;port B as input 22 | MOV DX,CW 23 | OUT DX,AL 24 | 25 | PRINTF M1 ;reading first 8 bit 26 | MOV AH,08H ;character no echo 27 | INT 21H 28 | MOV DX,PB 29 | IN AL,DX 30 | MOV BL,AL 31 | 32 | PRINTF M2 ;reading second 8 bit 33 | MOV AH,08H ;character no echo 34 | INT 21H 35 | MOV DX,PB 36 | IN AL,DX 37 | 38 | MUL BL ;X*Y.. multiplying 39 | 40 | MOV DX,PA ;displaying LSB on LCI 41 | OUT DX,AL 42 | 43 | CALL DELAY 44 | 45 | MOV AL,AH ;displaying MSB on LCI 46 | MOV DX,PA 47 | OUT DX,AL 48 | 49 | MOV AH,4CH 50 | INT 21H 51 | 52 | DELAY PROC NEAR 53 | MOV SI,0FFFFH 54 | Outer: 55 | MOV DI,0FFFFH 56 | Inner: 57 | DEC DI 58 | JNZ Inner 59 | DEC SI 60 | JNZ Outer 61 | RET 62 | DELAY ENDP 63 | 64 | END 65 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Rishabh Lakhotia 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /III Semester/OOPS-With-Java/12. Threads/MyThread.java: -------------------------------------------------------------------------------- 1 | class One extends Thread 2 | { 3 | 4 | One() 5 | { 6 | start(); 7 | } 8 | 9 | public void run() 10 | { 11 | for(;;) 12 | { 13 | try 14 | { 15 | sleep(1000); 16 | } 17 | catch(InterruptedException e) 18 | { 19 | } 20 | System.out.println("Good Morning"); 21 | } 22 | } 23 | } 24 | 25 | class Two extends Thread 26 | { 27 | Two() 28 | { 29 | start(); 30 | } 31 | 32 | public void run() 33 | { 34 | for(;;) 35 | { 36 | try 37 | { 38 | sleep(2000); 39 | } 40 | catch(InterruptedException e) 41 | { 42 | } 43 | System.out.println("Hello"); 44 | } 45 | } 46 | } 47 | 48 | class Three extends Thread 49 | { 50 | Three() 51 | { 52 | start(); 53 | } 54 | 55 | public void run() 56 | { 57 | for(;;) 58 | { 59 | try 60 | { 61 | sleep(3000); 62 | } 63 | catch(InterruptedException e) 64 | { 65 | } 66 | System.out.println("Welcome"); 67 | } 68 | } 69 | } 70 | 71 | class MyThread 72 | { 73 | public static void main(String args[]) 74 | { 75 | new One(); 76 | new Two(); 77 | new Three(); 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /IV Semester/ADA_Lab/5_Horspool/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | #define MAX 126 7 | 8 | int t[MAX]; 9 | int i,j,m,n,k; 10 | 11 | void shift_table( char p[]){ 12 | m=strlen(p); 13 | for (i=0;i=0) 53 | printf("The desired pattern is found at pos : %d\n",pos+1); 54 | else 55 | printf("Pattern not found\n"); 56 | getch(); 57 | 58 | } 59 | -------------------------------------------------------------------------------- /V Semester/Database-Management-System/Problem 5/README.md: -------------------------------------------------------------------------------- 1 | Problem Statement 2 | ================= 3 | 4 | ### Relations 5 | 6 | Consider the following database for a banking enterprise 7 | 8 | BRANCH(branch-name:string, branch-city:string, assets:real) 9 | 10 | ACCOUNT(accno:int, branch-name:string, balance:real) 11 | 12 | DEPOSITOR(customer-name:string, accno:int) 13 | 14 | CUSTOMER(customer-name:string, customer-street:string, customer-city:string) 15 | 16 | LOAN(loan-number:int, branch-name:string, amount:real) 17 | 18 | BORROWER(customer-name:string, loan-number:int) 19 | 20 | 21 | ### Queries 22 | 23 | 24 | 1. Create the above tables by properly specifying the primary keys and the foreign keys 25 | 26 | 2. Enter at least five tuples for each relation 27 | 28 | 3. Find all the customers who have at least two accounts at the Main branch. 29 | 30 | 4. Find all the customers who have an account at all the branches located in a specific city. 31 | 32 | 5. Demonstrate how you delete all account tuples at every branch located in a specific city. 33 | 34 | 6. Generate suitable reports. 35 | 36 | 7. Create suitable front end for querying and displaying the results. 37 | -------------------------------------------------------------------------------- /III Semester/Data-Structure-in-C/10. Max_Heap/Simplified Program/HEAP.C: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #define MAX_SIZE 100 4 | 5 | int heap[MAX_SIZE]; 6 | int n = 0; 7 | 8 | void createHeap(int item) { 9 | int c, p; 10 | if (n == MAX_SIZE) 11 | printf("Heap is full\n"); 12 | else { 13 | c = n; 14 | p = (c - 1) / 2; 15 | while (c != 0 && item > heap[p]) { 16 | heap[c] = heap[p]; 17 | c = p; 18 | p = (c - 1) / 2; 19 | } 20 | heap[c] = item; 21 | n++; 22 | } 23 | } 24 | 25 | void main() { 26 | int item, ch, i; 27 | clrscr(); 28 | while (1) { 29 | printf("1. create\t2. display : "); 30 | scanf("%d", &ch); 31 | switch (ch) { 32 | case 1: 33 | printf("Enter Item in heap\n"); 34 | scanf("%d", &item); 35 | createHeap(item); 36 | break; 37 | case 2: 38 | for (i = 0; i <= n; i++) 39 | printf("Heap[%d] = %d", i, heap[i]); 40 | break; 41 | default: 42 | exit(0); 43 | } 44 | } 45 | getch(); 46 | } 47 | -------------------------------------------------------------------------------- /IV Semester/ADA_Lab/8_Prims/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | int prims(int cost[10][10],int n,int v[10],int d[10],int source) 4 | { 5 | int i,j,min,u; 6 | v[source]=1; 7 | int sum=0; 8 | for(i=1;i<=n-1;i++) 9 | { 10 | min=999; 11 | for(j=1;j<=n;j++) 12 | { 13 | if(v[j]==0 && d[j]cost[u][j]) 25 | d[j]=cost[u][j]; 26 | } 27 | } 28 | return sum; 29 | } 30 | int main() 31 | { 32 | int i,j,n,source,cost[10][10],v[10],d[10],sum=999; 33 | printf("enter n \n"); 34 | scanf("%d",&n); 35 | printf("enter cost matrix\n"); 36 | for(i=1;i<=n;i++) 37 | for(j=1;j<=n;j++) 38 | scanf("%d",&cost[i][j]); 39 | printf("enter source\n"); 40 | scanf("%d",&source); 41 | for(i=1;i<=n;i++) 42 | { 43 | d[i]=cost[source][i]; 44 | v[i]=0; 45 | } 46 | sum=prims(cost,n,v,d,source); 47 | if(sum>=999) 48 | printf("MST DOESN'T EXIST\n"); 49 | else 50 | printf("cost of mst is %d",sum); 51 | return 0; 52 | } 53 | -------------------------------------------------------------------------------- /archives/VI Semester/Computer-Graphics/1_Retangular_mesh/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #define maxx 20 3 | #define maxy 25 4 | #define dx 15 5 | #define dy 10 6 | 7 | GLfloat x[maxx]={0.0},y[maxy]={0.0}; 8 | GLfloat x0=50.0, y0=50.0; 9 | GLint i,j; 10 | 11 | void myinit() 12 | { 13 | glClearColor(1.0,1.0,1.0,1.0); 14 | glColor3f(1.0,0.0,0.0); 15 | glPointSize(5.0); 16 | glMatrixMode(GL_PROJECTION); 17 | glLoadIdentity(); 18 | gluOrtho2D(0.0,500.0,0.0,500.0); 19 | } 20 | 21 | void display(void) 22 | { 23 | glClear(GL_COLOR_BUFFER_BIT); 24 | for(i=0;i 2 | 4 | 5 | 6 | 7 | 27 | 28 | 29 | 30 |
31 | 32 | 34 |
35 | 36 | 37 | -------------------------------------------------------------------------------- /III Semester/Data-Structure-in-C/2. USN/USN.C: -------------------------------------------------------------------------------- 1 | // Program to sort USN 2 | #include 3 | #include 4 | 5 | void main() { 6 | int i, j, n; 7 | // Structure of student 8 | struct stud { 9 | int USN, sem; 10 | char name[30]; 11 | } 12 | s[10], t; 13 | 14 | clrscr(); 15 | 16 | // Retrieving info of students 17 | printf("Enter the number of students\n"); 18 | scanf("%d", &n); 19 | for (i = 0; i < n; i++) { 20 | printf("Enter details of Student %d\n", i + 1); 21 | printf("USN: "); 22 | scanf("%d", &s[i].USN); 23 | printf("Name: "); 24 | scanf("%s", &s[i].name); 25 | printf("Sem: "); 26 | scanf("%d", &s[i].sem); 27 | } 28 | 29 | // Bubble sort with USN 30 | for (i = 0; i < n - 1; i++) 31 | for (j = 0; j < n - 1 - i; j++) { 32 | if (s[j].USN > s[j + 1].USN) { 33 | t = s[j]; 34 | s[j] = s[j + 1]; 35 | s[j + 1] = t; 36 | } 37 | } 38 | 39 | // Printing student info 40 | printf("\nUSN\tSEM\tNAME\n"); 41 | for (i = 0; i < n; i++) { 42 | printf("%d\t%d\t%s\n", s[i].USN, s[i].sem, s[i].name); 43 | } 44 | 45 | getch(); 46 | } 47 | -------------------------------------------------------------------------------- /III Semester/OOPS-With-Java/5. Complex-Number/ComplexNumberRun.java: -------------------------------------------------------------------------------- 1 | class ComplexNumber 2 | { 3 | double real; 4 | double imag; 5 | 6 | ComplexNumber() 7 | { 8 | real = 0.0; 9 | imag = 0.0; 10 | } 11 | ComplexNumber(double a) 12 | { 13 | real = a; 14 | imag = 0; 15 | } 16 | ComplexNumber(double a, double b) 17 | { 18 | real = a; 19 | imag = b; 20 | } 21 | ComplexNumber(ComplexNumber ob) 22 | { 23 | real = ob.real; 24 | imag = ob.imag; 25 | } 26 | 27 | void add(ComplexNumber c1, ComplexNumber c2) 28 | { 29 | double realSum = c1.real+c2.real; 30 | double imagSum = c1.imag+c2.imag; 31 | System.out.println("Sum is "+realSum+"+i"+imagSum); 32 | } 33 | 34 | void sub(ComplexNumber c1, ComplexNumber c2) 35 | { 36 | double realDiff = c1.real-c2.real; 37 | double imagDiff = c1.imag-c2.imag; 38 | System.out.println("Difference is "+realDiff+"-i"+imagDiff); 39 | } 40 | } 41 | 42 | class ComplexNumberRun 43 | { 44 | public static void main(String args[]) 45 | { 46 | ComplexNumber cn1 = new ComplexNumber(); 47 | ComplexNumber cn2 = new ComplexNumber(10); 48 | ComplexNumber cn3 = new ComplexNumber(20,30); 49 | ComplexNumber cn4 = new ComplexNumber(cn3); 50 | cn1.add(cn1,cn4); 51 | cn2.sub(cn2,cn3); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /I & II Semester/Programming-in-C/9. Employee-Structure/EmployeeStructure.c: -------------------------------------------------------------------------------- 1 | #include 2 | struct employee{ 3 | int eid,eage; 4 | char ename[20]; 5 | float esal; 6 | }; 7 | struct employee e[50]; 8 | void main(){ 9 | int n,i; 10 | 11 | //Read number of employees 12 | printf("Enter the number of Employees: "); 13 | scanf("%d",&n); 14 | //Read details of n- Employees 15 | for(i=0;i 2 | 3 | 4 | 5 | Praveen kumar 6 | 1ds07is017 7 | dayananad sagar 8 | info science 9 | 2007 10 | praveen@dsce.org 11 | 12 | 13 | 14 | Madhu kiran 15 | 1ds06is045 16 | dayanand sagar 17 | info science 18 | 2006 19 | kiran@dsce.org 20 | 21 | 22 | 23 | mohan kumar 24 | 1ds05is067 25 | dayanand sagar 26 | comp science 27 | 2005 28 | mohan@dsce.org 29 | 30 | 31 | 32 | 33 | mystyle.css 34 | student{clear:both;float:left;} 35 | name { background: red; color: white } 36 | usn { color: red;} 37 | collegeName { display:none} 38 | branch {color:orange;text-align: right; } 39 | year{background: red; color: yellow; } 40 | email{color: blue;} 41 | -------------------------------------------------------------------------------- /V Semester/Database-Management-System/Problem 3/README.md: -------------------------------------------------------------------------------- 1 | Problem Statement 2 | ================= 3 | 4 | ### Relations 5 | 6 | Consider the following database of student enrollment in courses & books adopted for each course. 7 | 8 | STUDENT (regno: string, name: string, major: string, bdate:date) 9 | 10 | COURSE (course #:int, cname:string, dept:string) 11 | 12 | ENROLL ( regno:string, course#:int, sem:int, marks:int) 13 | 14 | BOOK _ ADOPTION (course# :int, sem:int, book-ISBN:int) 15 | 16 | TEXT (book-ISBN:int, book-title:string, publisher:string, author:string) 17 | 18 | 19 | ### Queries 20 | 21 | 22 | 1. Create the above tables by properly specifying the primary keys and the foreign keys. 23 | 24 | 2. Enter at least five tuples for each relation. 25 | 26 | 3. Demonstrate how you add a new text book to the database and make this book be adopted by some 27 | department. 28 | 29 | 4. Produce a list of text books (include Course #, Book-ISBN, Book-title) in the alphabetical order for courses 30 | offered by the ‘CS’ department that use more than two books. 31 | 32 | 5. List any department that has all its adopted books published by a specific publisher. 33 | 34 | 6. Generate suitable reports. 35 | 36 | 7. Create suitable front end for querying and displaying the results. 37 | -------------------------------------------------------------------------------- /III Semester/OOPS-With-Java/9. Interface/MyVehicle.java: -------------------------------------------------------------------------------- 1 | interface Vehicle 2 | { 3 | void steering(); 4 | void brake(); 5 | } 6 | 7 | class Bus implements Vehicle 8 | { 9 | public void steering() 10 | { 11 | System.out.println("Bus Steering is round and medium sized"); 12 | } 13 | public void brake() 14 | { 15 | System.out.println("Always use brakes to stop the bus."); 16 | } 17 | } 18 | 19 | class Lorry implements Vehicle 20 | { 21 | public void steering() 22 | { 23 | System.out.println("Lorry Steering is round and big sized"); 24 | } 25 | public void brake() 26 | { 27 | System.out.println("Always use brakes to stop the Lorry."); 28 | } 29 | } 30 | 31 | class Car implements Vehicle 32 | { 33 | public void steering() 34 | { 35 | System.out.println("Car Steering is round and small sized"); 36 | } 37 | public void brake() 38 | { 39 | System.out.println("Always use brakes to stop the car."); 40 | } 41 | } 42 | 43 | class MyVehicle { 44 | 45 | public static void main(String[] args) { 46 | // TODO Auto-generated method stub 47 | Vehicle b = new Bus(); 48 | b.steering(); 49 | b.brake(); 50 | 51 | Vehicle v= new Lorry(); 52 | v.steering(); 53 | v.brake(); 54 | 55 | Vehicle c= new Car(); 56 | c.steering(); 57 | c.brake(); 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /IV Semester/ADA_Lab/7_Kruskal/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | void kruskall(int cost[][10],int n) 4 | { 5 | 6 | int parent[20]={0},min,mincost=0,ne=1; 7 | int i,j,u,v,a,b; 8 | while(ne=1; i--) 20 | cmp cl,01h ;if i == 1 return as prime 21 | JE Prime 22 | mov ax,0000h 23 | mov al,num 24 | div cl ;num/i 25 | cmp ah,00h ;if num%i == 0 return not a prime 26 | JE Not_Prime 27 | loop loop1 28 | 29 | Prime: 30 | lea dx,msg_prime 31 | jmp exit 32 | 33 | Not_Prime: 34 | lea DX,msg_nprime 35 | 36 | exit: 37 | call printf 38 | mov AH,4Ch 39 | int 21h 40 | 41 | ;procedure to read 8 bit number 42 | read_8bit proc near 43 | mov AH,01h ;reading 1st nibble 44 | int 21h 45 | sub AL,30h 46 | mov BL,AL 47 | mov AH,01h ;reading 2nd Nibble 48 | int 21h 49 | sub AL,30h 50 | mov AH,BL 51 | AAD ;ASCCI adjust before division 52 | mov num,AL 53 | ret 54 | read_8bit endp 55 | 56 | ;procedure to print string 57 | printf proc near 58 | mov ah,09h 59 | int 21h 60 | ret 61 | printf endp 62 | 63 | end -------------------------------------------------------------------------------- /V Semester/Database-Management-System/Problem 3/create_tables.sql: -------------------------------------------------------------------------------- 1 | -- Creating Student table 2 | 3 | CREATE TABLE Student ( 4 | regno VARCHAR(30), 5 | sname VARCHAR(30), 6 | major VARCHAR(30), 7 | bdate DATE, 8 | PRIMARY KEY (regno) 9 | ); 10 | 11 | DESC Student; 12 | 13 | 14 | -- Creating Course table 15 | 16 | CREATE TABLE Course ( 17 | course INT, 18 | cname VARCHAR(30), 19 | dept VARCHAR(30), 20 | PRIMARY KEY (course) 21 | ); 22 | 23 | DESC Course; 24 | 25 | 26 | -- Creating Enroll table 27 | 28 | CREATE TABLE Enroll ( 29 | regno VARCHAR(30), 30 | course INT, 31 | sem INT, 32 | marks INT, 33 | PRIMARY KEY (regno, course, sem), 34 | FOREIGN KEY (regno) REFERENCES Student(regno), 35 | FOREIGN KEY (course) REFERENCES Course(course)); 36 | 37 | DESC Enroll; 38 | 39 | 40 | -- Creating Text table 41 | 42 | CREATE TABLE Text ( 43 | bookisbn INT, 44 | booktitle VARCHAR(30), 45 | publisher VARCHAR(30), 46 | author VARCHAR(30), 47 | PRIMARY KEY (bookisbn) 48 | ); 49 | 50 | DESC Text; 51 | 52 | 53 | -- Creating BookAdoption table 54 | 55 | CREATE TABLE BookAdoption ( 56 | course INT, 57 | sem INT, 58 | bookisbn INT, 59 | PRIMARY KEY (course, sem, bookisbn), 60 | FOREIGN KEY (course) REFERENCES Course (course), 61 | FOREIGN KEY (bookisbn) REFERENCES Text (bookisbn) 62 | ); 63 | 64 | DESC BookAdoption; 65 | 66 | 67 | -------------------------------------------------------------------------------- /V Semester/Database-Management-System/Problem 1/fill_tables.sql: -------------------------------------------------------------------------------- 1 | -- Filling Student table with values 2 | 3 | INSERT INTO Student VALUES 4 | (2, 'Rishabh', 'EC', 'SR', 20), 5 | (3, 'Aditya', 'CS', 'SR', 20), 6 | (4, 'Siddharth', 'CS', 'JR', 18), 7 | (5, 'Amit', 'CS', 'SSR', 22), 8 | (6, 'Gargi', 'EC', 'SJR', 17) 9 | ; 10 | 11 | SELECT * FROM Student; 12 | 13 | -- Filling Faculty table with values 14 | 15 | INSERT INTO Faculty VALUES 16 | (55, 'Prof. Venkatasen', 7), 17 | (66, 'Prof. Prasad', 7), 18 | (77, 'Prof. Anupama', 8), 19 | (88, 'Prof. Poornima', 9), 20 | (99, 'Prof. Anil', 9) 21 | ; 22 | 23 | SELECT * FROM Faculty; 24 | 25 | 26 | -- Filling Class table with values 27 | 28 | INSERT INTO Class VALUES 29 | ('CS1', '12 HR', 'R128', 55), 30 | ('CS2', '11 HR', 'R138', 66), 31 | ('CS3', '12 HR', 'R148', 77), 32 | ('CS4', '11 HR', 'R158', 88), 33 | ('CS5', '12 HR', 'R168', 99), 34 | ('CS6', '1 HR', 'R138', 55), 35 | ('CS7', '2 HR', 'R148', 55), 36 | ('CS8', '3 HR', 'R158', 55), 37 | ('CS9', '4 HR', 'R168', 55) 38 | ; 39 | 40 | SELECT * FROM Class; 41 | 42 | 43 | -- Filling Enrolled table with values 44 | 45 | INSERT INTO Enrolled VALUES 46 | (2, 'CS1'), 47 | (3, 'CS2'), 48 | (4, 'CS1'), 49 | (5, 'CS4'), 50 | (6, 'CS5'), 51 | (2, 'CS3'), 52 | (3, 'CS4') 53 | ; 54 | 55 | SELECT * FROM Enrolled; 56 | -------------------------------------------------------------------------------- /V Semester/Database-Management-System/Problem 1/README.md: -------------------------------------------------------------------------------- 1 | Problem Statement 2 | ================= 3 | 4 | ### Relations 5 | 6 | Consider the following relations: 7 | 8 | Student (snum: integer, sname: string, major: string, level: string, age: integer) 9 | 10 | Class (name: string, meets at: string, room: string, fid: integer) 11 | 12 | Enrolled (snum: integer, cname: string) 13 | 14 | Faculty (fid: integer, fname: string, deptid: integer) 15 | 16 | 17 | The meaning of these relations is straightforward; for example, Enrolled has one record per student-class pair 18 | such that the student is enrolled in the class. Level is a two character code with 4 different values (example: 19 | Junior: JR etc) 20 | 21 | ### Queries 22 | 23 | Write the following queries in SQL. No duplicates should be printed in any of the answers. 24 | 25 | 1. Find the names of all Juniors (level = JR) who are enrolled in a class taught by Prof. Venkatesan 26 | 27 | 2. Find the names of all classes that either meet in room R128 or have five or more Students enrolled. 28 | 29 | 3. Find the names of all students who are enrolled in two classes that meet at the same time. 30 | 31 | 4. Find the names of faculty members who teach in every room in which some class is taught. 32 | 33 | 5. Find the names of faculty members for whom the combined enrollment of the courses that they teach is less 34 | than five. 35 | -------------------------------------------------------------------------------- /IV Semester/Microprocessor_and_Microcontroller_Lab/Extra/8086 NcR/prg.asm: -------------------------------------------------------------------------------- 1 | .model small 2 | 3 | .data 4 | n db 01h 5 | r db 01h 6 | msg_1 db 10,13,'nCr is : $' 7 | result db 00h 8 | 9 | .code 10 | mov AX,@data 11 | mov DS,AX 12 | 13 | lea dx,msg_1 ;printing message 14 | mov ah,09h 15 | int 21h 16 | call ncr ;call function 17 | 18 | mov DL,result 19 | call print_8bit 20 | 21 | mov ah,4ch 22 | int 21h 23 | 24 | ;recursive procedure to call NCR 25 | ncr proc near 26 | mov AL,n ;nCn right leaf node 27 | cmp r,AL 28 | JNE right_tree 29 | add result,01h ;Leaf node result++ 30 | ret 31 | right_tree: 32 | cmp r,00h ;nC0 left leaf node 33 | JNE main_fun 34 | add result,01h ;Leaf node result++ 35 | ret 36 | main_fun: 37 | dec n ;(n-1)Cr 38 | call ncr ;left tree 39 | dec r ;(n-1)C(r-1) 40 | call ncr ;right tree 41 | inc r ;traversing back to root 42 | inc n 43 | ret 44 | ncr endp 45 | 46 | ;procedure to display 8 bit character in decimal value in DL 47 | print_8bit proc near 48 | mov ax,0000h 49 | mov al,dl 50 | mov bx,0010d 51 | mov CX,0000h 52 | Loop_push: 53 | mov DX,0000h 54 | div BX 55 | push DX 56 | inc CX 57 | cmp AX,0000h 58 | JNE Loop_push 59 | Loop_pop: 60 | pop DX 61 | add dx,0030h ;converting the number to ASCII value 62 | mov ah,02h ;character display 63 | int 21h 64 | loop Loop_pop 65 | ret 66 | print_8bit endp 67 | 68 | end 69 | -------------------------------------------------------------------------------- /III Semester/Data-Structure-in-C/12. BST_Array_Display/BST.C: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #define SIZE 100 5 | 6 | int a[SIZE], c; 7 | void bst(int ele) { 8 | if (a[0] == NULL) { 9 | a[0] = ele; 10 | return; 11 | } 12 | c = 0; 13 | while (a[c] != NULL) { 14 | if (ele < a[c]) 15 | c = 2 * c + 1; 16 | else 17 | c = 2 * c + 2; 18 | } 19 | a[c] = ele; 20 | } 21 | 22 | void display() { 23 | int i; 24 | for (i = 0; i < SIZE; i++) { 25 | if (a[i] == NULL) 26 | continue; 27 | printf("a[%d]=%d\n", i, a[i]); 28 | } 29 | } 30 | 31 | void main() { 32 | int ch, i, j, ele; 33 | printf("\n1.bst\n2.display\n"); 34 | for (;;) { 35 | printf("\nEnter choice\n"); 36 | scanf("%d", &ch); 37 | switch (ch) { 38 | case 1: 39 | for (i = 0; i < SIZE; i++) a[i] = NULL; 40 | printf("\enter no of ele to enter\n"); 41 | scanf("%d", &j); 42 | printf("\nEnter the array of elements\n"); 43 | for (i = 0; i < j; i++) { 44 | scanf("%d", &ele); 45 | bst(ele); 46 | } 47 | break; 48 | case 2: 49 | display(); 50 | break; 51 | case 3: 52 | exit(0); 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /III Semester/Data-Structure-in-C/5. Evaluate_Postfix_Expression/POST_EVL.C: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | //Declare Global Variable 6 | int stack[20], top = -1; 7 | 8 | //Define push function 9 | void push(int x) { 10 | stack[++top] = x; 11 | } 12 | 13 | //Define pop function 14 | int pop() { 15 | return stack[top--]; 16 | } 17 | 18 | void main() { 19 | char s[20]; 20 | int x, y, i; 21 | 22 | clrscr(); 23 | printf("Enter the postfix Expression\n"); 24 | gets(s); 25 | 26 | for (i = 0; i < strlen(s); i++) { 27 | if (isdigit(s[i])) 28 | push(s[i] - '0'); 29 | else { 30 | y = pop(); 31 | x = pop(); 32 | switch (s[i]) { 33 | case '+': 34 | push(x + y); 35 | break; 36 | case '-': 37 | push(x - y); 38 | break; 39 | case '*': 40 | push(x * y); 41 | break; 42 | case '/': 43 | push(x / y); 44 | break; 45 | case '$': 46 | push(pow(x, y)); 47 | break; 48 | default: 49 | printf("Illegal Operator"); 50 | } 51 | } 52 | } 53 | 54 | //Print final result 55 | printf("\nResult: %d", pop()); 56 | getch(); 57 | } 58 | -------------------------------------------------------------------------------- /III Semester/OOPS-With-Java/7. Net-Salary/Employee.java: -------------------------------------------------------------------------------- 1 | import java.io.*; 2 | 3 | class EmployeeDetails 4 | { 5 | int emp_id; 6 | String emp_name; 7 | float basic_salary; 8 | EmployeeDetails(int id, String name, float sal) 9 | { 10 | emp_id=id; 11 | emp_name=name; 12 | basic_salary=sal; 13 | } 14 | void calculateSalary() 15 | { 16 | float da=basic_salary*40/100; 17 | float hra=basic_salary*20/100; 18 | float pf = basic_salary*10/100; 19 | float cca = 250; 20 | float pt = 100; 21 | float gross_sal=basic_salary+da+hra+cca; 22 | float it = gross_sal*10/100; 23 | float deductions = pt+it+pf; 24 | float netsal = gross_sal - deductions; 25 | System.out.println ("Employee Id= "+emp_id); 26 | System.out.println ("Emplyee Name= "+emp_name); 27 | System.out.println ("Gross Salary= "+gross_sal); 28 | System.out.println("Net Salary = "+netsal); 29 | } 30 | } 31 | public class Employee { 32 | 33 | public static void main(String[] args) throws IOException { 34 | BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); 35 | System.out.println ("Enter Employee id"); 36 | int id = Integer.parseInt(br.readLine()); 37 | System.out.println ("Enter Employee Name"); 38 | String name = br.readLine(); 39 | System.out.println ("Enter Basic Salary"); 40 | Float sal = Float.parseFloat(br.readLine()); 41 | EmployeeDetails e = new EmployeeDetails(id, name, sal); 42 | e.calculateSalary(); 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /V Semester/Database-Management-System/Problem 4/create_tables.sql: -------------------------------------------------------------------------------- 1 | -- Creating Author table 2 | 3 | CREATE TABLE Author ( 4 | authorid INT, 5 | name VARCHAR(30), 6 | city VARCHAR(30), 7 | country VARCHAR(30), 8 | PRIMARY KEY (authorid) 9 | ); 10 | 11 | DESC Author; 12 | 13 | 14 | -- Creating Publisher table 15 | 16 | CREATE TABLE Publisher ( 17 | publisherid INT, 18 | name VARCHAR(30), 19 | city VARCHAR(30), 20 | country VARCHAR(30), 21 | PRIMARY KEY (publisherid) 22 | ); 23 | 24 | DESC Publisher; 25 | 26 | 27 | -- Creating BookCategory table 28 | 29 | CREATE TABLE BookCategory ( 30 | categoryid INT , 31 | description VARCHAR(30), 32 | PRIMARY KEY (categoryid) 33 | ); 34 | 35 | DESC BookCategory; 36 | 37 | 38 | -- Creating Catalog table 39 | 40 | CREATE TABLE Catalog ( 41 | bookid INT, 42 | title VARCHAR(30), 43 | authorid INT, 44 | publisherid INT, 45 | categoryid INT, 46 | yearofpublish INT, 47 | price INT, 48 | PRIMARY KEY (bookid), 49 | FOREIGN KEY (authorid) REFERENCES Author (authorid), 50 | FOREIGN KEY (publisherid) REFERENCES Publisher (publisherid), 51 | FOREIGN KEY (categoryid) REFERENCES BookCategory (categoryid) 52 | ); 53 | 54 | DESC Catalog; 55 | 56 | 57 | -- Creating OrderDetails table 58 | 59 | CREATE TABLE OrderDetails ( 60 | orderno INT, 61 | bookid INT, 62 | quantity INT, 63 | PRIMARY KEY (orderno, bookid), 64 | FOREIGN KEY (bookid) REFERENCES Catalog(bookid) 65 | ); 66 | 67 | DESC OrderDetails; 68 | -------------------------------------------------------------------------------- /IV Semester/Microprocessor_and_Microcontroller_Lab/Part-A/2B_Display_Fire_Help/2B.asm: -------------------------------------------------------------------------------- 1 | .MODEL SMALL 2 | .DATA 3 | 4 | M1 DB 86H, 0AFH, 0CFH, 8EH ; E r I F 5 | M2 DB 8CH, 0C7H, 86H, 89H ; P L E H 6 | 7 | PA EQU 0D800H 8 | PB EQU 0D801H 9 | PC EQU 0D802H 10 | CW EQU 0D803H 11 | 12 | .CODE 13 | MOV AX,@DATA 14 | MOV DS, AX 15 | 16 | MOV DX,CW 17 | MOV AL,80H ;all ports are output 18 | OUT DX,AL 19 | 20 | L3: 21 | LEA SI, M1 ;display FIRE 22 | CALL DISPLAY 23 | CALL DELAY 24 | 25 | LEA SI, M2 26 | CALL DISPLAY ;display HELP 27 | CALL DELAY 28 | CALL STOP 29 | JMP L3 30 | 31 | EXIT: 32 | MOV AH,4CH 33 | INT 21H 34 | 35 | DISPLAY PROC NEAR ;display using port B for LED 36 | MOV CX,04H 37 | letter: 38 | MOV BL,08H 39 | MOV AL,[SI] 40 | segments: 41 | ROL AL,01H 42 | MOV DX,PB ;7 segment display with port B 43 | OUT DX,AL 44 | 45 | PUSH AX 46 | MOV AL,00H ;clock trigger 47 | MOV DX,PC 48 | OUT DX,AL 49 | MOV AL,01H 50 | OUT DX,AL 51 | POP AX 52 | 53 | DEC BL 54 | JNZ segments 55 | 56 | INC SI 57 | LOOP letter 58 | RET 59 | DISPLAY ENDP 60 | 61 | STOP PROC NEAR 62 | MOV AH,01H 63 | INT 16H ;if nothing in keyboard buffer 64 | JNZ EXIT 65 | RET 66 | STOP ENDP 67 | 68 | DELAY PROC NEAR 69 | PUSH SI 70 | 71 | MOV SI,0FFFFH 72 | Outer: 73 | MOV DI,0FFFFH 74 | Inner: 75 | DEC DI 76 | JNZ Inner 77 | DEC SI 78 | JNZ Outer 79 | 80 | POP SI 81 | RET 82 | DELAY ENDP 83 | 84 | END 85 | -------------------------------------------------------------------------------- /III Semester/Data-Structure-in-C/10. Max_Heap/maxHeap.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int a[100], n, i, root, c, temp, ch; 6 | 7 | void createheap(int i) { 8 | if (i == 0) //location is zero 9 | { 10 | root = i; 11 | return; 12 | } else { 13 | c = i; 14 | while (c != 0) { 15 | root = (c - 1) / 2; 16 | if (a[root] <= a[c]) //parent is less than child swap 17 | { 18 | temp = a[root]; 19 | a[root] = a[c]; 20 | a[c] = temp; 21 | } 22 | c = root; 23 | } 24 | } 25 | } 26 | 27 | void display() { 28 | printf("Max heap\n "); 29 | for (i = 0; i < n; i++) 30 | printf("%d\t", a[i]); 31 | } 32 | 33 | void main() { 34 | clrscr(); 35 | for (;;) { 36 | printf("1. create Max Heap\n2. display\n3. exit\n"); 37 | printf("enter ur choice\n"); 38 | scanf("%d", &ch); 39 | switch (ch) { 40 | case 1: 41 | printf("enter the number of nodes\n"); 42 | scanf("%d", &n); 43 | printf("enter the elements\n"); 44 | for (i = 0; i < n; i++) { 45 | scanf("%d", &a[i]); 46 | createheap(i); 47 | } 48 | break; 49 | case 2: 50 | display(); 51 | break; 52 | default: 53 | exit(0); 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /IV Semester/Microprocessor_and_Microcontroller_Lab/Part-A/4B_Display_System_Time/4B.asm: -------------------------------------------------------------------------------- 1 | .MODEL SMALL 2 | .DATA 3 | 4 | PA EQU 0D800H 5 | PB EQU 0D801H 6 | PC EQU 0D802H 7 | CW EQU 0D803H 8 | 9 | HO DB ? 10 | M DB ? 11 | S DB ? 12 | MS DB ? 13 | 14 | TABLE DB 0C0H,0F9H,0A4H,0B0H,99H,92H,82H,0F8H,80H,90H 15 | 16 | .CODE 17 | MOV AX,@DATA 18 | MOV DS,AX 19 | 20 | MOV DX,CW 21 | MOV AL,80H ;All ports are outputs 22 | OUT DX,AL 23 | 24 | MOV AH,2CH ;read system time 25 | INT 21H 26 | MOV HO,CH 27 | MOV M,CL 28 | MOV S,DH 29 | MOV MS,DL 30 | 31 | MOV AL,M ;HH:MM 32 | CALL UNPACK 33 | MOV AL,HO 34 | CALL UNPACK 35 | 36 | CALL DELAY 37 | 38 | MOV AL,MS ;SS:MS 39 | CALL UNPACK 40 | MOV AL,S 41 | CALL UNPACK 42 | 43 | MOV AH,4CH 44 | INT 21H 45 | 46 | UNPACK PROC NEAR 47 | AAM ;ASCII Codes for multiplication 48 | CALL DISPLAY 49 | MOV AL,AH 50 | CALL DISPLAY 51 | RET 52 | UNPACK ENDP 53 | 54 | DISPLAY PROC NEAR 55 | LEA BX,TABLE ;match the bcd number 56 | XLAT 57 | 58 | MOV BL,08D 59 | SEGMENTS: 60 | ROL AL,01H 61 | MOV DX,PB 62 | OUT DX,AL 63 | 64 | PUSH AX 65 | MOV DX,PC 66 | MOV AL,00H 67 | OUT DX,AL 68 | MOV AL,01H 69 | OUT DX,AL 70 | POP AX 71 | 72 | DEC BL 73 | JNZ SEGMENTS 74 | RET 75 | DISPLAY ENDP 76 | 77 | DELAY PROC NEAR 78 | PUSH SI 79 | PUSH DI 80 | 81 | MOV SI,0FFFFH 82 | Outer: 83 | MOV DI,0FFFFH 84 | Inner: 85 | DEC DI 86 | JNZ Inner 87 | DEC SI 88 | JNZ Outer 89 | 90 | POP DI 91 | POP SI 92 | RET 93 | DELAY ENDP 94 | 95 | END 96 | -------------------------------------------------------------------------------- /IV Semester/Microprocessor_and_Microcontroller_Lab/Part-A/4A_Palindrome_Or_Not/4A.asm: -------------------------------------------------------------------------------- 1 | .model small 2 | 3 | .data 4 | msg_1 db 10,13,'Enter a String: $' 5 | buff1 db 100 6 | len1 db ? 7 | str1 db 100 dup(?) 8 | rstr db 100 dup(?) 9 | msg_p db 10,13,'Its Palindrome$' 10 | msg_np db 10,13,'Not Palindrome$' 11 | 12 | .code 13 | mov AX,@data 14 | mov DS,AX 15 | mov ES,AX 16 | 17 | lea DX,msg_1 ;Display message 18 | call printf 19 | lea DX,buff1 ;Entering String 20 | call gets ;stores in str1 with len1 as length 21 | 22 | ;reversing string by taking SI for source and DI for destination 23 | lea SI,str1 24 | lea DI,rstr ;rstr[start] 25 | mov CX,0000h 26 | mov cl,len1 ;CX = len(str) 27 | add SI,CX 28 | dec SI ;str[end] 29 | 30 | reverse: 31 | mov AL,[SI] 32 | mov [DI],AL 33 | inc DI 34 | dec SI 35 | loop reverse 36 | mov AL,'$' ;ending the string 37 | mov [DI],AL ;comparing strings 38 | mov cx,0000h 39 | mov cl,len1 ;counter set to length of string 40 | lea SI,str1 41 | lea DI,rstr 42 | cld ;clear direction flag 43 | repe cmpsb ;instruction to compare byte by byte 44 | JE Palindrome 45 | lea DX,msg_np 46 | jmp exit 47 | 48 | Palindrome: 49 | lea DX,msg_p 50 | 51 | exit: 52 | call printf 53 | mov AH,4Ch 54 | int 21h 55 | 56 | ;procedure to scan a string 57 | gets proc near 58 | mov AH,0Ah ;instruction to read a string 59 | int 21h 60 | ret 61 | gets endp 62 | 63 | ;procedure to print string 64 | printf proc near 65 | mov AH,09h 66 | int 21h 67 | ret 68 | printf endp 69 | 70 | end -------------------------------------------------------------------------------- /V Semester/Database-Management-System/Problem 2/README.md: -------------------------------------------------------------------------------- 1 | Problem Statement 2 | ================= 3 | 4 | ### Relations 5 | 6 | The following relations keep track of airline flight information: 7 | 8 | Flights (no: integer, from: string, to: string, distance: integer, Departs: time, arrives: time, price: real) 9 | 10 | Aircraft (aid: integer, aname: string, cruisingrange: integer) 11 | 12 | Certified (eid: integer, aid: integer) 13 | 14 | Employees (eid: integer, ename: string, salary: integer) 15 | 16 | 17 | Note that the Employees relation describes pilots and other kinds of employees as well; Every pilot is certified 18 | for some aircraft, and only pilots are certified to fly. 19 | 20 | ### Queries 21 | 22 | Write each of the following queries in SQL: 23 | 24 | 1. Find the names of aircraft such that all pilots certified to operate them have salaries more than Rs.80, 000. 25 | 26 | 2. For each pilot who is certified for more than three aircrafts, find the eid and the maximum cruisingrange of 27 | the aircraft for which she or he is certified. 28 | 29 | 3. Find the names of pilots whose salary is less than the price of the cheapest route from Bengaluru to Frankfurt. 30 | 31 | 4. For all aircraft with cruisingrange over 1000 Kms,. Find the name of the aircraft and the average salary of all 32 | pilots certified for this aircraft. 33 | 34 | 5. Find the names of pilots certified for some Boeing aircraft. 35 | 36 | 6. Find the aids of all aircraft that can be used on routes from Bengaluru to New Delhi. 37 | -------------------------------------------------------------------------------- /I & II Semester/Programming-in-C/6. Matrices-Product/MatricesProduct.c: -------------------------------------------------------------------------------- 1 | #include 2 | void main(){ 3 | int a[10][10],b[10][10],c[10][10],i,j,k,m,n,p,q; 4 | printf("Enter the size of matrix A\n"); 5 | scanf("\n%d%d",&m,&n);//read size of Matrix A 6 | printf("Enter the size of matrix B\n"); 7 | scanf("\n%d%d",&p,&q);//read size of Matrix B 8 | if(n!=p)//check for compatability 9 | printf("Matrix multiplication is not possible"); 10 | else 11 | { 12 | printf("Enter the elements of Matrix A\n"); 13 | for(i=0;i 2 | 3 |
4 | NAME:
5 | add1:
6 | add2:
7 | email:
8 | Submit: 9 |
10 | 11 |
12 | Name:
13 | Submit: 14 |
15 | 16 | 17 | 18 | 19 | 34 | 35 | 36 | "; 44 | echo "NameAddress1Address2EmailID"; 45 | 46 | while ($arr = mysql_fetch_row($res)) 47 | echo "$arr[0]$arr[1]$arr[2]$arr[3]"; 48 | echo ""; 49 | ?> 50 | -------------------------------------------------------------------------------- /IV Semester/Microprocessor_and_Microcontroller_Lab/Part-A/2A_Display_ASCII/2A.asm: -------------------------------------------------------------------------------- 1 | .model small 2 | 3 | .data 4 | msg_1 db 10,13,'Enter a Alphanumeric Character: $' 5 | msg_2 db 10,13,'ASCII value is: $' 6 | char dw ? 7 | 8 | .code 9 | mov AX,@data 10 | mov DS,AX 11 | 12 | lea DX,msg_1 ;Display Message 13 | mov AH,09h ;instruction 14 | int 21h ;BIOS Interrupt 15 | mov AH,01h ;Instruction to read character 16 | int 21h ;& store in AL as hex ASCII value 17 | mov ah,00h 18 | mov char,ax 19 | 20 | ;clear Screen 21 | mov ah,06h ;clear screen instruction 22 | mov al,00h ;number of lines to scroll 23 | mov bh,07h ;display attribute - colors 24 | mov ch,00d ;start row 25 | mov cl,00d ;start col 26 | mov dh,24d ;end of row 27 | mov dl,79d ;end of col 28 | int 10h ;BIOS interrupt 29 | 30 | ;cursor to middle 31 | mov ah,02h ;move cursor Instruction 32 | mov bh,00h ;Page 0 33 | mov dh,12d ;row 34 | mov dl,39d ;column 35 | int 10h ;BIOS interrupt 36 | 37 | ;printing 8 bit value in decimal digit by digit 38 | lea DX,msg_2 ;Display Message 39 | mov AH,09h ;instruction 40 | int 21h ;BIOS Interrupt 41 | mov AX,char ;ax = character 42 | mov BX,10d 43 | mov CX,0000h 44 | 45 | L_Stack: ;pushing to stack 46 | mov DX,0000h ;DX = remainder 47 | div BX 48 | push DX ;push(remainder) 49 | inc CX ;top++ 50 | cmp AX,0000h 51 | JNE L_Stack ;jump if ax not equal to 0 52 | loop_pop: ;popping from stack 53 | pop DX 54 | add DX,0030h ;HexD ASCII conversion 31h(ASCII) = 1 55 | mov AH,02h ;Display character which is in hexD ascii 56 | int 21h 57 | loop loop_pop 58 | 59 | mov AH,4Ch 60 | int 21h 61 | end 62 | -------------------------------------------------------------------------------- /IV Semester/Microprocessor_and_Microcontroller_Lab/Part-A/1A_Binary_Search/BSearch.asm: -------------------------------------------------------------------------------- 1 | .model small 2 | .data 3 | key db ? 4 | A db 05h,03h,07d,04h,01h 5 | l db $-A 6 | m db 10,13,"Enter the key to be searched: $" 7 | m1 db 10,13,'The key was Found$' 8 | m2 db 10,13,'Key not found$' 9 | .code 10 | mov ax,@data 11 | mov ds,ax 12 | 13 | lea dx,m 14 | call printf 15 | 16 | call read8 ;read 8 bit number 17 | 18 | mov key,al 19 | mov bl,l ;bubble sort 20 | dec bl 21 | xor bh,bh 22 | l2: 23 | mov cx,bx 24 | lea si,A 25 | l1: mov al,[si] 26 | inc si 27 | cmp al,[si] 28 | jbe noswap 29 | xchg al,[si] 30 | mov [si-1],al 31 | noswap:loop l1 32 | dec bx 33 | jnz l2;sorting ends 34 | 35 | ;binary search 36 | lea si,A 37 | mov di,si 38 | mov bl,l 39 | xor bh,bh 40 | add di,bx 41 | dec di 42 | lp1:cmp si,di 43 | ja nf 44 | mov bx,si 45 | add bx,di 46 | shr bx,01h 47 | mov al,key 48 | cmp al,[bx] 49 | jz found 50 | ja nlow 51 | mov di,bx 52 | dec di 53 | jmp lp1 54 | nlow:mov si,bx 55 | inc si 56 | jmp lp1 57 | found:lea dx,m1 58 | call printf 59 | jmp exit 60 | nf:lea dx,m2 61 | call printf 62 | exit: 63 | mov ah,4ch 64 | int 21h 65 | 66 | printf proc near ; procedure for printf 67 | mov ah,09h 68 | int 21h 69 | ret 70 | printf endp 71 | 72 | read8 proc near ;procedure for reading 8 bit number 73 | mov ah,01h 74 | int 21h 75 | mov bh,al 76 | sub bh,30h 77 | mov ah,01h 78 | int 21h 79 | sub al,30h 80 | mov ah,bh 81 | aad 82 | ret 83 | read8 endp 84 | 85 | end 86 | -------------------------------------------------------------------------------- /III Semester/OOPS-With-Java/2. Fibonacci-Sequence/FibDemo.java: -------------------------------------------------------------------------------- 1 | import java.util.Scanner; 2 | class Fib { 3 | public int recfib(int n) 4 | { 5 | if(n==0) 6 | return 0; 7 | else if(n==1) 8 | return 1; 9 | else 10 | return recfib(n-1)+recfib(n-2); 11 | } 12 | 13 | 14 | public int nonrecfib(int n) 15 | { 16 | int fib1=0, fib2=1, fib3=0; 17 | if (n==0) 18 | System.out.println(fib1); 19 | else if (n==1) 20 | System.out.println(fib1+" "+fib2); 21 | else 22 | { 23 | System.out.println("0 1"); 24 | for(int i=0;i 3 | #include 4 | 5 | void main() { 6 | int i, j, p, q, a[10][10], k = 0, key; 7 | 8 | // Sparse matrix structure 9 | struct matrix { 10 | int r, c, v; 11 | } 12 | m[10]; 13 | 14 | // Input the Sparse matrix 15 | printf("Enter no. of Rows &Cols: "); 16 | scanf("%d %d", &p, &q); 17 | printf("Enter the Matrix: "); 18 | for (i = 0; i < p; i++) 19 | for (j = 0; j < q; j++) { 20 | scanf("%d", &a[i][j]); 21 | if (a[i][j] != 0) { 22 | m[k].r = i + 1; 23 | m[k].c = j + 1; 24 | m[k].v = a[i][j]; 25 | k++; 26 | } 27 | } 28 | 29 | // printing the non-zero values 30 | for (i = 0; i < p; i++) 31 | for (j = 0; j < q; j++) { 32 | printf("%d", a[i][j]); 33 | } 34 | 35 | printf("_________________________________________"); 36 | printf("\nRow\tColumn\tvalue\n"); 37 | printf("_________________________________________"); 38 | for (i = 0; i < k; i++) { 39 | printf("\n%d\t%d\t%d", m[k].r, m[k].c, m[k].v); 40 | } 41 | 42 | // taking in the key &Searching it 43 | printf("\n\nEnter the Search element: "); 44 | scanf("%d", &key); 45 | for (i = 0; i < k; i++) { 46 | if (key == m[i].v) { 47 | printf("\nResult found at loc: %d %d", m[i].r, m[i].c); 48 | getch(); 49 | } 50 | } 51 | printf("\nResults not found"); 52 | getch(); 53 | } 54 | -------------------------------------------------------------------------------- /VI Semester/System-Software-and-Operating-System/8B-Avoiding-Zombie-Process/8b.c: -------------------------------------------------------------------------------- 1 | /* Write a C/Java program to avoid zombie process by forking twice. 2 | */ 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | int main() 9 | { 10 | pid_t pid; 11 | if ((pid=fork())< 0) 12 | { 13 | printf("Fork error"); 14 | } 15 | else if( pid==0) 16 | { 17 | printf("first child pid=%d\n", getpid()); 18 | if((pid=fork())< 0) 19 | printf("Fork error"); 20 | else if( pid > 0) 21 | exit(0); 22 | sleep(5); 23 | printf("second child pid = %d\n parent pid=%d\n", getpid(), getppid()); 24 | exit (0); 25 | } 26 | } 27 | 28 | /* 29 | ************************** 30 | Program output: 31 | [root@localhost ~]# vi p8b.c 32 | [root@localhost ~]# cc 8b.c 33 | [root@localhost ~]# ./a.out 34 | first child pid=4071 35 | second child pid = 4072 36 | parent of second child pid=4071 37 | PID PPID STAT CMD 38 | 1 0 Ss init [5] 39 | 2 0 S< [kthreadd] 40 | 3 2 S< [migration/0] 41 | 4 2 S< [ksoftirqd/0] 42 | 5 2 S< [watchdog/0] 43 | 6 2 S< [migration/1] 44 | 7 2 S< [ksoftirqd/1] 45 | ........ 46 | 4070 2686 S+ ./a.out 47 | 4071 4070 S+ ./a.out 48 | 4072 4071 Z+ [a.out] 49 | 4073 4071 R+ ps -e -o pid,ppid,stat,cmd 50 | second child pid = 4071 51 | parent of second child pid=4070 52 | */ -------------------------------------------------------------------------------- /archives/VI Semester/Internet-and-Web-Technologies/3_Javascript_Validation/3b.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 33 | 34 | 35 | 36 |
37 | Enter your USN. :

38 | Enter your Sem. :

39 | 41 |
42 | 43 | 44 | -------------------------------------------------------------------------------- /V Semester/Database-Management-System/Problem 5/create_tables.sql: -------------------------------------------------------------------------------- 1 | -- Creating Branch table 2 | 3 | CREATE TABLE Branch ( 4 | branchname VARCHAR(30), 5 | branchcity VARCHAR(30), 6 | assets REAL, 7 | PRIMARY KEY (branchname) 8 | ); 9 | 10 | DESC Branch; 11 | 12 | 13 | -- Creating BankAccount table 14 | 15 | CREATE TABLE BankAccount ( 16 | accno INT, 17 | branchname VARCHAR(30), 18 | balance REAL, 19 | PRIMARY KEY (accno), 20 | FOREIGN KEY (branchname) REFERENCES Branch (branchname) 21 | ); 22 | 23 | DESC BankAccount; 24 | 25 | 26 | -- Creating BankCustomer table 27 | 28 | CREATE TABLE BankCustomer ( 29 | customername VARCHAR(30), 30 | customerstreet VARCHAR(30), 31 | customercity VARCHAR(30), 32 | PRIMARY KEY (customername) 33 | ); 34 | 35 | DESC BankCustomer; 36 | 37 | 38 | -- Creating Depositer table 39 | 40 | CREATE TABLE Depositer ( 41 | customername VARCHAR(30), 42 | accno INT, 43 | PRIMARY KEY (customername, accno), 44 | FOREIGN KEY (customername) REFERENCES BankCustomer (customername), 45 | FOREIGN KEY (accno) REFERENCES BankAccount (accno) 46 | ); 47 | 48 | DESC Depositer; 49 | 50 | 51 | -- Creating Loan table 52 | 53 | CREATE TABLE Loan ( 54 | loannumber INT, 55 | branchname VARCHAR(30), 56 | amount REAL, 57 | PRIMARY KEY (loannumber), 58 | FOREIGN KEY (branchname) REFERENCES Branch (branchname) 59 | ); 60 | 61 | DESC Loan; 62 | 63 | 64 | -- Creating Borrower table 65 | 66 | CREATE TABLE Borrower ( 67 | customername VARCHAR(30), 68 | loannumber INT, 69 | PRIMARY KEY (customername, loannumber), 70 | FOREIGN KEY (customername) REFERENCES BankCustomer (customername), 71 | FOREIGN KEY (loannumber) REFERENCES Loan (loannumber) 72 | ); 73 | 74 | DESC Borrower; 75 | -------------------------------------------------------------------------------- /archives/VI Semester/Internet-and-Web-Technologies/1_External_CSS_Popup/1a.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | LAB Program 1A 8 | 9 | 10 | 11 |
12 |

Welcome To Web Programming Laboratory

13 |
14 | 15 | Fruits and Vegetables 16 | 17 |
    18 |
  1. Fruits 19 | 20 |
      21 |
    1. Apple
    2. 22 |
    3. Banana
    4. 23 |
    5. Orange
    6. 24 |
    25 | 26 |
  2. 27 | 28 |
  3. Vegetables 29 | 30 |
      31 |
    1. Tomato
    2. 32 |
    3. Carrot
    4. 33 |
    5. Onion
    6. 34 |
    35 | 36 |
  4. 37 |
38 | 39 | 40 | 41 | 42 | 43 | 44 |
SUBJECTLECTURER
Java ProgrammingPraveen Kumar A.G
Computer NetworkM.S patel
Unix System programmingHarish.S
45 | 46 |

sure you will get a lot of FUN in Web programming 47 | laboartry

48 |

In this lab we will Learn XHTML,CSS,JavaScript,perl and Php

49 |

XHTML,CSS,JavaScript are used as client side programming

50 |

Perl and Php are use as server side programming

51 | 52 | 53 | -------------------------------------------------------------------------------- /III Semester/OOPS-With-Java/1. Quadratic-Equation/QuadraticEquation.java: -------------------------------------------------------------------------------- 1 | import java.util.Scanner; 2 | public class QuadraticEquation { 3 | public static void main(String[] args) { 4 | int a, b, c; 5 | double root1, root2, d; 6 | Scanner s = new Scanner(System.in); 7 | System.out.println("Given quadratic equation:ax^2 + bx + c"); 8 | System.out.print("Enter a:"); 9 | a = s.nextInt(); 10 | System.out.print("Enter b:"); 11 | b = s.nextInt(); 12 | System.out.print("Enter c:"); 13 | c = s.nextInt(); 14 | if(a==0 && b==0) 15 | System.out.println("No Solution"); 16 | else if(a==0) { 17 | System.out.println("Linear Equation: root = "+(-c/b)); 18 | } 19 | 20 | else { 21 | System.out.println("Given quadratic equation:"+a+"x^2 + "+b+"x + "+c); 22 | d = b * b - 4 * a * c; 23 | if(d > 0) 24 | { 25 | System.out.println("Roots are real and distinct"); 26 | root1 = ( - b + Math.sqrt(d))/(2*a); 27 | root2 = (-b - Math.sqrt(d))/(2*a); 28 | System.out.println("First root is:"+root1); 29 | System.out.println("Second root is:"+root2); 30 | } 31 | else if(d == 0) 32 | { 33 | System.out.println("Roots are real and equal"); 34 | root1 = (-b+Math.sqrt(d))/(2*a); 35 | System.out.println("Root1=Root2=:"+root1); 36 | } 37 | else 38 | { 39 | System.out.println("No real solutions. Roots are imaginary"); 40 | } 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /V Semester/Database-Management-System/Problem 4/fill_tables.sql: -------------------------------------------------------------------------------- 1 | -- Filling Author table with values 2 | 3 | INSERT INTO Author VALUES 4 | (1, 'NAVATHE', 'ARLINGTON', 'USA'), 5 | (2, 'RAGHU RAMAKRISHNAN', 'CALIFORNIA', 'USA'), 6 | (3, 'DHAMDHERE', 'MUMBAI', 'INDIA'), 7 | (4, 'BJARNE', 'NEW JERSY', 'USA'), 8 | (5, 'TANENBAUM', 'AMSTERDAM','NETHERLAND') 9 | ; 10 | 11 | SELECT * FROM Author; 12 | 13 | 14 | -- Filling Publisher table with values 15 | 16 | INSERT INTO Publisher VALUES 17 | (1, 'JOHN WILEY', 'NEW YORK', 'USA'), 18 | (2, 'PEARSON', 'BANGALORE', 'INDIA'), 19 | (3, 'O REILLY', 'NEW JERSY', 'USA'), 20 | (4, 'TMH', 'CALCUTTA', 'INDIA'), 21 | (5, 'JOHN WILEY', 'NEW DELHI', 'INDIA') 22 | ; 23 | 24 | SELECT * FROM Publisher; 25 | 26 | 27 | -- Filling BookCategory table with values 28 | 29 | INSERT INTO BookCategory VALUES 30 | (1, 'DATABASE MANAGEMENT'), 31 | (2, 'OPERATING SYSTEMS'), 32 | (3, 'C++'), 33 | (4, 'COMPUTER NETWORKS'), 34 | (5, 'C') 35 | ; 36 | 37 | SELECT * FROM BookCategory; 38 | 39 | 40 | -- Filling Catalog table with values 41 | 42 | INSERT INTO Catalog VALUES 43 | (1, 'FUNDAMENTALS OF DBMS', 1, 2, 1, 2004, 500), 44 | (2, 'PRINCIPLES OF DBMS', 2, 1, 1, 2004, 400), 45 | (3, 'OPERATING SYSTEMS', 3, 4, 2, 2004, 200), 46 | (4, 'C++ BIBLE', 4, 5, 3, 2003, 500), 47 | (5, 'COMPUTER NETWORKS', 5, 3, 4, 2002, 250), 48 | (6, 'FUNDAMENTALS OF C', 1, 2, 5, 2004, 700), 49 | (7, 'OPERATING SYSTEMS 2', 3, 2, 2, 2001, 600) 50 | ; 51 | 52 | SELECT * FROM Catalog; 53 | 54 | 55 | -- Filling OrderDetails table with values 56 | 57 | INSERT INTO OrderDetails VALUES 58 | (1, 1, 1), 59 | (2, 2, 1), 60 | (3, 3, 1), 61 | (4, 4, 1), 62 | (5, 5, 1), 63 | (6, 6, 7), 64 | (7, 7, 9) 65 | ; 66 | 67 | SELECT * FROM OrderDetails; 68 | 69 | -------------------------------------------------------------------------------- /III Semester/Data-Structure-in-C/6. Working of Queue/q_ops.c: -------------------------------------------------------------------------------- 1 | #include 2 | #define size 5 3 | 4 | //Declare operation functions 5 | void qinsert(int, int *, int[]); 6 | void qdelete(int *, int *, int[]); 7 | void qdisplay(int, int, int[]); 8 | 9 | //Main function 10 | void main() { 11 | int q[size], item, ch, front = 0, rear = -1; 12 | clrscr(); 13 | 14 | //Continuous Loop 15 | while (1) { 16 | printf("\n1: Insert\t2: Delete\t3: Display\tElse: Exit\n"); 17 | scanf("%d", &ch); 18 | switch (ch) { 19 | 20 | case 1: 21 | printf("Enter Element: "); 22 | scanf("%d", &item); 23 | qinsert(item, &rear, q); 24 | break; 25 | 26 | case 2: 27 | qdelete( &front, &rear, q); 28 | break; 29 | 30 | case 3: 31 | qdisplay(front, rear, q); 32 | break; 33 | 34 | default: 35 | printf("Invalid Operation"); 36 | getch(); 37 | exit(0); 38 | } 39 | } 40 | } 41 | 42 | void qinsert(int item, int *rear, int q[]) { 43 | if (*rear == size - 1) 44 | printf("Queue is full\n"); 45 | else { 46 | *rear = *rear + 1; 47 | q[*rear] = item; 48 | } 49 | } 50 | 51 | void qdelete(int *front, int *rear, int q[]) { 52 | if (*front > *rear) 53 | printf("Queue is empty\n"); 54 | else { 55 | printf("The Deleted element is %d", q[*front]); 56 | *front = *front + 1; 57 | } 58 | } 59 | 60 | void qdisplay(int front, int rear, int q[]) { 61 | int i; 62 | if (front > rear) 63 | printf("Queue is empty"); 64 | else { 65 | for (i = front; i <= rear; i++) 66 | printf("Queue[%d] = %d\n", i, q[i]); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /V Semester/Database-Management-System/Problem 2/fill_tables.sql: -------------------------------------------------------------------------------- 1 | -- Filling Aircraft table with values 2 | 3 | INSERT INTO Aircraft VALUES 4 | (1, 'Airbus', 2000), 5 | (2, 'Boeing', 700), 6 | (3, 'Jet', 550), 7 | (4, 'Dreamliner', 5000), 8 | (5, 'Boeing', 4500), 9 | (6, 'Airbus', 2200) 10 | ; 11 | 12 | SELECT * FROM Aircraft; 13 | 14 | 15 | -- Filling Employees table with values 16 | 17 | INSERT INTO Employees VALUES 18 | (162, 'Andrew', 50000), 19 | (183, 'Laeddis', 60000), 20 | (192, 'Rachel', 70000), 21 | (204, 'Solando', 82000), 22 | (300, 'Tony', 5000) 23 | ; 24 | 25 | SELECT * FROM Employees; 26 | 27 | 28 | -- Filling Certified table with values 29 | 30 | INSERT INTO Certified VALUES 31 | (162, 2), 32 | (162, 4), 33 | (162, 5), 34 | (162, 6), 35 | (183, 1), 36 | (183, 3), 37 | (183, 5), 38 | (192, 2), 39 | (192, 3), 40 | (192, 5), 41 | (192, 6), 42 | (204, 6), 43 | (204, 1), 44 | (204, 3), 45 | (300, 3) 46 | ; 47 | 48 | SELECT * FROM Certified; 49 | 50 | 51 | -- Filling Flights table with values 52 | 53 | INSERT INTO Flights VALUES 54 | (1, 'Bengaluru', 'New Delhi', 500, TIMESTAMP '2014-11-4 09:24:26', TIMESTAMP '2014-11-4 09:24:26', 5000), 55 | (2, 'Bengaluru', 'Chennai', 300, TIMESTAMP '2014-11-4 09:24:26', TIMESTAMP '2014-11-4 09:24:26', 3000), 56 | (3, 'Trivandrum', 'New Delhi', 800, TIMESTAMP '2014-11-4 09:24:26', TIMESTAMP '2014-11-4 09:24:26', 6000), 57 | (4, 'Bengaluru', 'Frankfurt', 10000, TIMESTAMP '2014-11-4 09:24:26', TIMESTAMP '2014-11-4 09:24:26', 50000), 58 | (5, 'Kolkata', 'New Delhi', 2400, TIMESTAMP '2014-11-4 09:24:26', TIMESTAMP '2014-11-4 09:24:26', 9000), 59 | (6, 'Bengaluru', 'Frankfurt', 8000, TIMESTAMP '2014-11-4 09:24:26', TIMESTAMP '2014-11-4 09:24:26', 40000) 60 | ; 61 | 62 | SELECT * FROM Flights; 63 | -------------------------------------------------------------------------------- /IV Semester/Microprocessor_and_Microcontroller_Lab/Extra/8086 Separate_Even_Odd/prg.asm: -------------------------------------------------------------------------------- 1 | .model small 2 | 3 | .data 4 | arr db 10,20,99,98,97,100 5 | len db $-arr 6 | n db 2 7 | d dw 10 8 | eve db 5 dup(?) 9 | odd db 5 dup(?) 10 | m1 db 10,13,'even array elements are $' 11 | m2 db 10,13,'odd array elements are $' 12 | 13 | .code 14 | mov ax,@data 15 | mov ds,ax 16 | 17 | mov ax,00h 18 | lea si,arr 19 | lea di,eve 20 | lea bx,odd 21 | mov ch,00h 22 | mov cl,len 23 | 24 | l2:mov al,[si] ;checking if a number is odd or even 25 | div n 26 | cmp ah,00h 27 | jz l1 28 | mov al,[si] ;storing the number in odd array 29 | mov [bx],al 30 | inc bx 31 | jmp lab 32 | l1:mov al,[si] 33 | mov [di],al ;storing the number in even array 34 | inc di 35 | lab:inc si 36 | loop l2 37 | 38 | lea di,eve 39 | lea bx,odd 40 | lea dx,m1 41 | mov ah,09h 42 | int 21h 43 | 44 | l5:mov ah,[di] 45 | cmp ah,00h 46 | jz go 47 | mov al,[di] 48 | call printspace ;calling printspace procedure to print the space 49 | call printf ;printing the values 50 | inc di 51 | jmp l5 52 | 53 | go:lea dx,m2 54 | mov ah,09h 55 | int 21h 56 | 57 | back:mov ah,[bx] 58 | cmp ah,00h 59 | jz exit 60 | mov al,[bx] 61 | call printspace 62 | call printf 63 | inc bx 64 | jmp back 65 | 66 | exit:mov ah,4ch 67 | int 21h 68 | 69 | printspace proc near 70 | mov n,al 71 | mov dl,' ' 72 | mov ah,02h 73 | int 21h 74 | mov ah,00h 75 | mov al,n 76 | ret 77 | printspace endp 78 | 79 | printf proc near 80 | mov cx,00h 81 | l3:mov dx,0000h 82 | div d 83 | push dx 84 | inc cx 85 | cmp ax,00h 86 | jnz l3 87 | l4:pop dx 88 | add dl,30h 89 | mov ah,02h 90 | int 21h 91 | loop l4 92 | mov cx,00h 93 | ret 94 | printf endp 95 | 96 | end 97 | -------------------------------------------------------------------------------- /V Semester/Computer-Networks/vector.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | struct network 4 | { 5 | int dist[10], outgoing[10]; 6 | }; 7 | struct network nodes[10]; 8 | 9 | void intialize(int n) 10 | { 11 | int i, j; 12 | for(i = 0; i < n; i++) 13 | for(j = 0; j < n; j++) 14 | { 15 | nodes[i].outgoing[j] = j; 16 | if(i == j) 17 | nodes[i].dist[j] = 0; 18 | else 19 | nodes[i].dist[j] = 999; 20 | } 21 | } 22 | 23 | void floyd(int n) 24 | { 25 | int i, j, k; 26 | 27 | for(k = 0; k < n; k++) 28 | for(i = 0; i < n; i++) 29 | for(j = 0; j < n; j++) 30 | if(nodes[i].dist[j] > nodes[i].dist[k] + nodes[k].dist[j]) 31 | { 32 | nodes[i].outgoing[j] = k; 33 | nodes[i].dist[j] = nodes[i].dist[k] + nodes[k].dist[j]; 34 | } 35 | } 36 | 37 | int main() 38 | { 39 | int n, i, j; 40 | 41 | printf("Enter number of Nodes: "); 42 | scanf("%d",&n); 43 | intialize(n); 44 | 45 | printf("Enter the Distances\n"); 46 | for(i=0;i>y)); 38 | break; 39 | case 6: 40 | System.out.println("NOT of x :"+(~x)); 41 | System.out.println("NOT of y :"+(~y)); 42 | break; 43 | case 7: 44 | System.out.println("Thankyou"); 45 | System.exit(1); 46 | break; 47 | default: 48 | System.out.println("Invalid chioce, Please enter the correct choice"); 49 | } 50 | } while(choice!=7); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /archives/VI Semester/Internet-and-Web-Technologies/4_JS_stack_rise_on_top/4b.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 15 | 16 | 51 | 52 | 53 |

This is para 1...

55 |

This is para 2...

57 |

This is para 3...

59 | 60 | 61 | -------------------------------------------------------------------------------- /VI Semester/System-Software-and-Operating-System/8A-Zombie-Process/8a.c: -------------------------------------------------------------------------------- 1 | /* Write a C/Java program that creates a zombie and then calls system to 2 | execute the ps command to verify that the process is zombie. 3 | */ 4 | #include 5 | #include 6 | #include 7 | #include 8 | int main() 9 | { 10 | pid_t child_pid; 11 | /* Create a child process. */ 12 | child_pid = fork (); 13 | if (child_pid > 0) 14 | { 15 | printf("This is the parent process: %d. Sleep for a minute\n",getpid()); 16 | sleep (60); 17 | } 18 | else 19 | { 20 | printf("This is the child process: %d. Exit immediately\n",getpid()); 21 | exit (0); 22 | } 23 | system("ps -e -o pid,ppid,stat,cmd"); 24 | return 0; 25 | } 26 | /* 27 | ************************** 28 | Program output: 29 | [root@localhost ~]# vim 8a.c 30 | [root@localhost ~]# cc 8a.c 31 | [root@localhost ~]# ./a.out 32 | This is the child process: 8822. Exit immediately 33 | This is the parent process: 8821. Sleep for a minute 34 | PID PPID STAT CMD 35 | 1 0 Ss init [5] 36 | 2 0 S< [kthreadd] 37 | 3 2 S< [migration/0] 38 | 4 2 S< [ksoftirqd/0] 39 | 5 2 S< [watchdog/0] 40 | 6 2 S< [migration/1] 41 | 7 2 S< [ksoftirqd/1] 42 | .... 43 | 8788 8782 SN sleep 506 44 | 8798 2793 T vim p7.c 45 | 8821 2793 S+ ./a.out 46 | 8822 8821 Z+ [a.out] 47 | 8825 8821 R+ ps -e -o pid,ppid,stat,cmd 48 | */ -------------------------------------------------------------------------------- /V Semester/Database-Management-System/Problem 3/fill_tables.sql: -------------------------------------------------------------------------------- 1 | -- Filling Student table with values 2 | 3 | INSERT INTO Student VALUES 4 | ('1DS16CS735', 'Rishabh', 'DBMS', '1994-06-24'), 5 | ('1DS16CS747', 'Siddharth', 'ADA', '1993-11-9'), 6 | ('1DS16CS701', 'Aditya', 'GTC', '1994-04-28'), 7 | ('1DS16CS703', 'Amit', 'SE', '1993-10-7'), 8 | ('1DS16CS730', 'Gargi', 'DS', '1993-09-12') 9 | ; 10 | 11 | SELECT * FROM Student; 12 | 13 | 14 | -- Filling Course table with values 15 | 16 | INSERT INTO Course VALUES 17 | (1, 'DBMS', 'CS'), 18 | (2, 'ADA', 'CS'), 19 | (3, 'GTC', 'TC'), 20 | (4, 'SE', 'EE'), 21 | (5, 'DS', 'EC'), 22 | (6, 'DS', 'CS') 23 | ; 24 | 25 | SELECT * FROM Course; 26 | 27 | 28 | -- Filling Text table with values 29 | 30 | INSERT INTO Text VALUES 31 | (1, 'FUNDAMENTALS OF DBMS', 'PEARSON', 'RAMEZ ELMASRI'), 32 | (2, 'DESGIN OF ALGORITHMS','UNIVERSITY PRESS', 'SAHNI'), 33 | (3, 'GRAPH THEORY', 'PRISM', 'DSC'), 34 | (4, 'SE BIBLE','PEARSON', 'MEENA'), 35 | (5, 'POWER OF JAVA', 'SUN', 'JAMES GOSLING'), 36 | (6, 'POWER OF C', 'JOHN WILEY', 'DENNISRITCHIE'), 37 | (7, 'CORMEN ALGORITHMS', 'PEARSON', 'CLRS'), 38 | (8, 'INTRODUCTION TO C++', 'JOHN WILEY', 'HERBERT SHIELD'), 39 | (9, 'DATABASE', 'JOHN WILEY', 'SHAMKANT'), 40 | (10, 'ENGG MATH', 'PRISM', 'KSC') 41 | ; 42 | SELECT * FROM Text; 43 | 44 | 45 | 46 | -- Filling Enroll table with values 47 | 48 | INSERT INTO Enroll VALUES 49 | ('1DS16CS735', 1, 5, 98), 50 | ('1DS16CS747', 2, 3, 88), 51 | ('1DS16CS701', 3, 5, 91), 52 | ('1DS16CS703', 4, 5, 76), 53 | ('1DS16CS730', 5, 5, 49) 54 | ; 55 | 56 | SELECT * FROM Enroll; 57 | 58 | 59 | 60 | -- Filling BookAdoption table with values 61 | 62 | INSERT INTO BookAdoption VALUES 63 | (1, 5, 1), 64 | (1, 4, 4), 65 | (2, 3, 2), 66 | (3, 5, 3), 67 | (4, 5, 4), 68 | (5, 5, 5), 69 | (6, 4, 6), 70 | (6, 4, 7), 71 | (6, 4, 8) 72 | ; 73 | 74 | SELECT * FROM BookAdoption; 75 | -------------------------------------------------------------------------------- /IV Semester/Microprocessor_and_Microcontroller_Lab/Part-A/6A_Fibonacci_Number/6A.asm: -------------------------------------------------------------------------------- 1 | .model small 2 | 3 | .data 4 | msg_1 db 10,13,'Enter the Number: $' 5 | msg_2 db 10,13,'0 1 $' 6 | num dw ? 7 | a dw 0h 8 | b dw 01h 9 | 10 | .code 11 | mov AX,@data 12 | mov DS,AX 13 | lea DX,msg_1 14 | call printf 15 | call read_8bit 16 | 17 | mov cx,num ;counter till nth number 18 | sub cx,02h ;decrement by 2 as first 2 are printed 19 | lea DX,msg_2 20 | call printf 21 | 22 | loop1: ;Fibonacci loop 23 | mov AX,a ;temporarily assigning to REG 24 | add AX,b ;a = a + b ; c = AX 25 | mov a,AX ;restoring a as c 26 | mov DI,CX ;storing the counter temporarily in DI 27 | mov DX,AX ;stored in DL to print Number 28 | call print_8bit ;display nth number 29 | mov AX,a 30 | XCHG AX,b ;a=b and b=a(which is c) 31 | mov a,AX 32 | mov CX,DI ;restoring counter 33 | loop loop1 34 | 35 | mov AH,4Ch 36 | int 21h 37 | 38 | ;procedure to display 8 bit character in decimal value in DL 39 | print_8bit proc near 40 | mov ax,0000h 41 | mov al,dl 42 | mov bx,0010d 43 | mov CX,0000h 44 | Loop_push: 45 | mov DX,0000h 46 | div BX 47 | push DX 48 | inc CX 49 | cmp AX,0000h 50 | JNE Loop_push 51 | Loop_pop: 52 | pop DX 53 | add dx,0030h ;converting the number to ASCII value 54 | mov ah,02h ;character display 55 | int 21h 56 | loop Loop_pop 57 | mov dl,' ' ;printing space 58 | mov ah,02h 59 | int 21h 60 | ret 61 | print_8bit endp 62 | 63 | ;procedure to read 8 bit numbers & store in AL 64 | read_8bit proc near 65 | mov AH,01h ;reading 1st nibble 66 | int 21h 67 | sub AL,30h 68 | mov BL,AL 69 | mov AH,01h ;reading 2nd Nibble 70 | int 21h 71 | sub AL,30h 72 | mov AH,BL 73 | AAD ;ASCCI adjust before division 74 | mov num,AX 75 | ret 76 | read_8bit endp 77 | 78 | ;procedure to print message 79 | printf proc near 80 | mov AH,09h 81 | int 21h 82 | ret 83 | printf endp 84 | 85 | end 86 | -------------------------------------------------------------------------------- /III Semester/OOPS-With-Java/3. Matrix-Multiplication/MatrixMul.java: -------------------------------------------------------------------------------- 1 | import java.util.Scanner; 2 | 3 | public class MatrixMul { 4 | 5 | public static void main(String[] args) { 6 | 7 | // TODO Auto-generated method stub 8 | Scanner s=new Scanner(System.in); 9 | 10 | int m,n; 11 | System.out.println("enter the values of m and n"); 12 | m=s.nextInt(); 13 | n=s.nextInt(); 14 | 15 | int p,q; 16 | System.out.println("enter the values of p and q"); 17 | p=s.nextInt(); 18 | q=s.nextInt(); 19 | 20 | if(n!=p) 21 | System.out.println("Matrix multiplication not possible"); 22 | else 23 | { 24 | int a[][]=new int[m][n]; 25 | int b[][]=new int[p][q]; 26 | int i,j,k; 27 | int c[][]=new int[m][q]; 28 | 29 | System.out.println("enter the elements of Matrix A"); 30 | for(i=0;i 2 | 4 | 5 | 6 | 7 | 17 | 18 | 53 | 54 | 55 |

56 | This is para 1... 57 |

58 |

59 | This is para 2... 60 |

61 |

62 | This is para 3... 63 |

64 | 65 | 66 | -------------------------------------------------------------------------------- /VI Semester/System-Software-and-Operating-System/6-Shift-Reduce-Parsing/6.c: -------------------------------------------------------------------------------- 1 | /* Design, develop and implement YACC/C program to demonstrate Shift Reduce Parsing 2 | technique for the grammar rules: E E+T | T, T T*F | F, F (E) | id 3 | and parse the sentence: id + id * id. 4 | */ 5 | #include 6 | #include 7 | #include 8 | int k=0,z=0,i=0,j=0,c=0; 9 | char a[16],ac[20],stk[15],act[10]; 10 | void check(); 11 | void main() 12 | { 13 | puts("GRAMMAR is E->E+E \n E->E*E \n E->(E) \n E->id"); 14 | puts("enter input string "); 15 | gets(a); 16 | c=strlen(a); 17 | strcpy(act,"SHIFT->"); 18 | puts("stack \t input \t action"); 19 | for(k=0,i=0; j 2 | #include 3 | 4 | static float x1=250.0,y1=150.0,x2=150.0,y2=250.0,x3=250.0,y3=350.0,x4=350.0,y4=250.0; 5 | 6 | void edgeDetect(float x1,float y1,float x2,float y2,int *le, int *re) 7 | { 8 | float mx, x, temp; 9 | int i; 10 | if((y2-y1)<0) 11 | { 12 | temp=y1;y1=y2;y2=temp; 13 | temp=x1;x1=x2;x2=temp; 14 | } 15 | if((y2-y1)!=0) 16 | mx=(x2-x1)/(y2-y1); 17 | else 18 | mx=x2-x1; 19 | x=x1; 20 | for(i=y1;i<=y2;i++) 21 | { 22 | if(x<(float)le[i]) le[i]=(int)x; 23 | if(x>(float)re[i]) re[i]=(int)x; 24 | x+=mx; 25 | } 26 | } 27 | 28 | void drawPixel(int x,int y) 29 | { 30 | glColor3f(1.0,1.0,0.0); 31 | glBegin(GL_POINTS); 32 | glVertex2i(x,y); 33 | glEnd(); 34 | } 35 | 36 | void scanFill(float x1,float y1,float x2,float y2,float x3,float y3,float x4,float y4) 37 | { 38 | int le[500],re[500]; 39 | int i,y; 40 | for(i=0;i<500;i++) 41 | { 42 | le[i]=500; 43 | re[i]=0; 44 | } 45 | edgeDetect(x1,y1,x2,y2,le,re); 46 | edgeDetect(x2,y2,x3,y3,le,re); 47 | edgeDetect(x3,y3,x4,y4,le,re); 48 | edgeDetect(x4,y4,x1,y1,le,re); 49 | for(y=0;y<500;y++) 50 | { 51 | if(le[y]<=re[y]) 52 | for(i=(int)le[y];i<(int)re[y];i++) 53 | drawPixel(i,y); 54 | } 55 | } 56 | 57 | void display(void) 58 | { 59 | glClear(GL_COLOR_BUFFER_BIT); 60 | glColor3f(1.0,1.0,0.0); 61 | glBegin(GL_LINE_LOOP); 62 | glVertex2f(x1,y1); 63 | glVertex2f(x2,y2); 64 | glVertex2f(x3,y3); 65 | glVertex2f(x4,y4); 66 | glEnd(); 67 | scanFill(x1,y1,x2,y2,x3,y3,x4,y4); 68 | glFlush(); 69 | } 70 | 71 | void myInit(void) 72 | { 73 | glClearColor(1.0,1.0,1.0,1.0); 74 | gluOrtho2D(0.0,500.0,0.0,500.0); 75 | } 76 | 77 | void main(void) 78 | { 79 | glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB); 80 | glutInitWindowSize(500,500); 81 | glutCreateWindow("Scan Line fill"); 82 | glutDisplayFunc(display); 83 | myInit(); 84 | glutMainLoop(); 85 | } 86 | -------------------------------------------------------------------------------- /V Semester/Computer-Networks/rsa.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int mod_exp(int base, int exp, int n) //returns (base^exp) modulo n 5 | { 6 | int i, power = 1; 7 | for(i = 0; i < exp; i++) 8 | power = (power * base) % n; 9 | return power; 10 | } 11 | 12 | int gcd(int m,int n) //Highest common factor of m and n 13 | { 14 | int temp; 15 | while(1) 16 | { 17 | temp = m % n; 18 | if(temp == 0) 19 | return(n); 20 | m = n; 21 | n = temp; 22 | } 23 | } 24 | 25 | int main() 26 | { 27 | int p = 3, q = 11, n, e, phi, d, i, j; 28 | char data[20]=" "; 29 | int cipherData[20]={0}, decrData[20]; 30 | 31 | n = p * q; 32 | phi = (p - 1) * (q - 1); 33 | e = 2; //encryptor is a coprime to phi and (1 < e < phi) 34 | d = 2; 35 | 36 | //finding encrypot value (e) 37 | while(e < phi) 38 | { 39 | if( gcd(e, phi) == 1) //co-primes 40 | break; 41 | e++; 42 | } 43 | printf("\nValue of e is: %d", e); 44 | 45 | //finding decryptor value (d) 46 | while(d < phi) 47 | { 48 | if( ((e * d) % phi) == 1 ) 49 | break; 50 | d++; 51 | } 52 | printf("\nValue of d is: %d", d); 53 | 54 | printf("\nEnter a String: "); 55 | gets(data); 56 | printf("\nThe entered string is: %s \n",data); 57 | 58 | //Encryption at server with Public key (n, e) 59 | for(i = 0; i < strlen(data); i++) 60 | { 61 | cipherData[i] = mod_exp(data[i], e, n); 62 | printf("%c = %d\n", data[i], cipherData[i]); 63 | } 64 | 65 | //Decryption at Client with Private Key (n, d) 66 | printf("\nDecrypted string is: "); 67 | for(i=0;i 2 | #include 3 | 4 | int knpsk ( int ,int ,int[], int[], int[][100]); 5 | void optn ( int ,int,int[],int[],int[][100]); 6 | int max(int, int); 7 | 8 | void main(){ 9 | 10 | int w[20], max_wt,p[20],n,i,j,value,v[10][100]; 11 | clrscr(); 12 | 13 | printf("Enter the no. of items\n"); 14 | scanf("%d",&n); 15 | 16 | printf("Enter the capacity of the KNAPSACK\n"); 17 | scanf("%d",&max_wt); 18 | 19 | printf("Enter the value of each item\n"); 20 | for(i=1;i<=n;i++) 21 | scanf("%d",&p[i]); 22 | 23 | printf("Enter the weight of each item\n"); 24 | for(i=1;i<=n;i++) 25 | scanf("%d",&w[i]); 26 | 27 | value=knpsk(n,max_wt,w,p,v); 28 | 29 | printf("Solution of the KNAPSACK problem is \n"); 30 | for(i=0;i<=n;i++){ 31 | for(j=0;j<=max_wt;j++){ 32 | printf("%d\t",v[i][j]); 33 | } 34 | printf("\n"); 35 | } 36 | 37 | 38 | printf("The maximum profit is %d:\n",value); 39 | printf("The option selected are :\n"); 40 | optn(n,max_wt,w,p,v); 41 | 42 | getch(); 43 | 44 | } 45 | 46 | int knpsk (int n, int max_wt, int w[], int p[], int v[10][100]) 47 | { 48 | int i,j; 49 | for(i=0;i<=n;i++) 50 | { 51 | for(j=0;j<=max_wt;j++) 52 | { 53 | 54 | //if there is no item or capacity of Knapsack is zero 55 | if(i==0 || j==0) 56 | v[i][j]=0; 57 | //if weight of ith item is greater than the capacity of knapsack 58 | else if(w[i]>j) 59 | v[i][j]= v[i-1][j]; 60 | else 61 | v[i][j]=max(v[i-1][j],p[i]+v[i-1][j-w[i]]); 62 | } 63 | 64 | } 65 | return (v[n][max_wt]); 66 | } 67 | 68 | void optn (int n,int max_wt,int w[],int p[],int v[10][100]) 69 | { 70 | int i,j; 71 | i=n; 72 | j=max_wt; 73 | while((i!=0)&& (j!=0)) 74 | { 75 | if( v[i][j]!= v[i-1][j] ) 76 | { 77 | printf("Value:%d Weight %d:\n",p[i],w[i]); 78 | j=j-w[i]; 79 | } 80 | i--; 81 | } 82 | 83 | } 84 | 85 | int max ( int a, int b) 86 | { 87 | return ( (a>b)?a:b); 88 | } 89 | -------------------------------------------------------------------------------- /V Semester/Computer-Networks/crc.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #define lenKey strlen(key) 5 | 6 | char Tdata[128], checkSum[128], key[] = "10001000000100001"; 7 | int lenTdata; 8 | 9 | void xor() 10 | { 11 | int i; 12 | for(i = 0; i < lenKey; i++) 13 | checkSum[i] = checkSum[i] == key[i] ? '0' : '1'; 14 | } 15 | void crc() //Modulo 2 Division 16 | { 17 | int i, j; 18 | 19 | for(i = 0; i < lenKey; i++) 20 | checkSum[i] = Tdata[i]; 21 | 22 | while(i < lenTdata + lenKey) 23 | { 24 | if(checkSum[0] == '1') 25 | xor(); 26 | 27 | for(j = 0; j < (lenKey - 1); j++) 28 | checkSum[j] = checkSum[j + 1]; 29 | 30 | checkSum[j] = Tdata[i++]; 31 | } 32 | } 33 | 34 | int main() 35 | { 36 | int i, input; 37 | 38 | printf("\n\nEnter Tramsmission Data: "); 39 | scanf("%s",Tdata); 40 | lenTdata = strlen(Tdata); 41 | printf("Generator Polynomial is: %s",key); 42 | 43 | for(i = lenTdata; i < (lenTdata + lenKey - 1); i++) 44 | Tdata[i] = '0'; 45 | 46 | crc(); 47 | for(i = lenTdata; i < (lenTdata + lenKey - 1); i++) 48 | Tdata[i] = checkSum[i - lenTdata]; 49 | printf("\nCode Word is: %s",Tdata); 50 | 51 | printf("\nTest Error Detection? yes(1) or no(0): "); 52 | scanf("%d",&input); 53 | if(input == 1) //Yes 54 | { 55 | printf("\nEnter Postion to enter the error: "); 56 | scanf("%d",&i); 57 | Tdata[i] = Tdata[i] == '1'? '0' : '1'; //Tdata manipulated 58 | printf("\nData Recieved at reciever (With Error): %s",Tdata); 59 | } 60 | 61 | crc(); 62 | 63 | for(i = 0; i < lenKey - 1; i++) //check if the checksum is all 0's 64 | if(checkSum[i] == '1') //if '1' in any digit .. error detected 65 | { 66 | printf("\n\nError Detected ;( \n\n"); 67 | exit(0); 68 | } 69 | 70 | printf("\n\nNo Error Detected!!\n\n"); 71 | return(0); 72 | } 73 | -------------------------------------------------------------------------------- /III Semester/Data-Structure-in-C/7. Singly_Linked_list_Operations/SLL.C: -------------------------------------------------------------------------------- 1 | 2 | //C program to perform operations on Singly Linked List 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | //Define Structure 9 | struct node { 10 | int data; 11 | struct node * link; 12 | }; 13 | 14 | typedef struct node * NODE; 15 | 16 | NODE first = NULL; 17 | 18 | //Function to insert in the beginning 19 | void insert_beg() { 20 | NODE temp; 21 | temp = (NODE)malloc(sizeof(NODE)); 22 | printf("Enter the Element: "); 23 | scanf("%d", &temp -> data); 24 | temp -> link = NULL; 25 | if (first == NULL) { 26 | first = temp; 27 | return; 28 | } 29 | temp -> link = first; 30 | first = temp; 31 | } 32 | 33 | //Funtion to insert in the end 34 | void insert_end() { 35 | NODE cur, temp; 36 | temp = (NODE) malloc(sizeof(NODE)); 37 | printf("Enter the element: "); 38 | scanf("%d", &temp -> data); 39 | temp -> link = NULL; 40 | if (first == NULL) { 41 | first = temp; 42 | return; 43 | } 44 | cur = first; 45 | while (cur -> link != NULL) 46 | cur = cur -> link; 47 | cur -> link = temp; 48 | } 49 | 50 | //Function to Display List 51 | void display() { 52 | NODE cur; 53 | if (first == NULL) { 54 | printf("List is Empty\n"); 55 | return; 56 | } 57 | printf("\nList Elements are: \n"); 58 | cur = first; 59 | while (cur != NULL) { 60 | printf("%d\t", cur -> data); 61 | cur = cur -> link; 62 | } 63 | } 64 | 65 | //Main Function 66 | void main() { 67 | int ch; 68 | clrscr(); 69 | for (;;) { 70 | printf("\n1: Insert Begining\t2: Insert End\t3: Display\tElse: Exit\n"); 71 | scanf("%d", &ch); 72 | switch (ch) { 73 | 74 | case 1: 75 | insert_beg(); 76 | break; 77 | 78 | case 2: 79 | insert_end(); 80 | break; 81 | 82 | case 3: 83 | display(); 84 | break; 85 | 86 | default: 87 | exit(0); 88 | } 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /archives/VI Semester/Computer-Graphics/2_Sierpinski_Gasket/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | typedef float point[3]; 4 | 5 | point v[]={ {0.0,0.0,1.0}, {0.0,1.0,-0.33}, {-0.8, -0.5, -0.33}, {0.8,-0.5,-0.33}}; 6 | int n; 7 | 8 | void triangle(point a, point b, point c) 9 | { 10 | glBegin(GL_POLYGON); 11 | glVertex3fv(a); 12 | glVertex3fv(b); 13 | glVertex3fv(c); 14 | glEnd(); 15 | } 16 | 17 | void divide_tri(point a,point b,point c,int m) 18 | { 19 | point v1,v2,v3; 20 | int j; 21 | if (m>0) { 22 | for(j=0;j<3;j++) v1[j]=(a[j]+b[j])/2; 23 | for(j=0;j<3;j++) v2[j]=(a[j]+c[j])/2; 24 | for(j=0;j<3;j++) v3[j]=(b[j]+c[j])/2; 25 | divide_tri(a,v1,v2,m-1); 26 | divide_tri(c,v2,v3,m-1); 27 | divide_tri(b,v3,v1,m-1); 28 | } 29 | else 30 | triangle(a,b,c); 31 | } 32 | 33 | void tetrahedron(int m) 34 | { 35 | glColor3f(1.0,0.0,0.0); 36 | divide_tri(v[0],v[1],v[2],m); 37 | glColor3f(0.0,1.0,0.0); 38 | divide_tri(v[3],v[2],v[1],m); 39 | glColor3f(0.0,0.0,1.0); 40 | divide_tri(v[0],v[3],v[1],m); 41 | glColor3f(0.0,0.0,0.0); 42 | divide_tri(v[0],v[2],v[3],m); 43 | } 44 | 45 | void display(void) 46 | { 47 | glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT); 48 | tetrahedron(n); 49 | glFlush(); 50 | } 51 | 52 | void myReshape(int w,int h) 53 | { 54 | glViewport(0,0,w,h); 55 | glMatrixMode(GL_PROJECTION); 56 | glLoadIdentity(); 57 | if(w<=h) 58 | glOrtho(-2.0,2.0,-2.0*(GLfloat)h/(GLfloat)w,2.0*(GLfloat)h/(GLfloat)w,-10.0,10.0); 59 | else 60 | glOrtho(-2.0*(GLfloat)w/(GLfloat)h,2.0*(GLfloat)w/(GLfloat)h,-2.0,2.0,-10.0,10.0); 61 | glMatrixMode(GL_MODELVIEW); 62 | glutPostRedisplay(); 63 | } 64 | 65 | void main(int argc,char **argv) 66 | { 67 | printf("Enter the number of recursive steps you want\n"); 68 | scanf("%d", &n); 69 | glutInit(&argc,argv); 70 | glutInitDisplayMode(GLUT_SINGLE|GLUT_RGB|GLUT_DEPTH); 71 | glutInitWindowSize(500,500); 72 | glutCreateWindow("3d gasket"); 73 | glutReshapeFunc(myReshape); 74 | glutDisplayFunc(display); 75 | //glEnable(GL_DEPTH_TEST); 76 | glClearColor(1.0,1.0,1.0,1.0); 77 | glutMainLoop(); 78 | } 79 | -------------------------------------------------------------------------------- /IV Semester/Microprocessor_and_Microcontroller_Lab/Part-A/5B_8x3_Keypad/5B.asm: -------------------------------------------------------------------------------- 1 | .MODEL SMALL 2 | .DATA 3 | KEYS DB '0123456789ABCDEFGHIJKLMN' 4 | M1 DB 10,13,'Row: $' 5 | M2 DB 10,13,'Column: $' 6 | M3 DB 10,13,'Value: $' 7 | ROW DB ? 8 | COL DB ? 9 | 10 | PA EQU 0D800H 11 | PB EQU 0D801H 12 | PC EQU 0D802H 13 | CW EQU 0D803H 14 | 15 | .CODE 16 | MOV AX,@DATA 17 | MOV DS,AX 18 | 19 | MOV DX,CW 20 | MOV AL,90H ;port A is input 21 | OUT DX,AL 22 | 23 | READ: 24 | MOV DX,PC ;trigger port C for row 1 25 | MOV AL,01H 26 | OUT DX,AL 27 | 28 | MOV DX,PA ;read input from port A 29 | IN AL,DX 30 | CMP AL,00H 31 | JNZ FR 32 | 33 | MOV DX,PC ;trigger port C for row 2 34 | MOV AL,02H 35 | OUT DX,AL 36 | 37 | MOV DX,PA ;read input from port A 38 | IN AL,DX 39 | CMP AL,00H 40 | JNZ SR 41 | 42 | MOV DX,PC ;trigger port C for row 3 43 | MOV AL,04H 44 | OUT DX,AL 45 | 46 | MOV DX,PA ;read input from port A 47 | IN AL,DX 48 | CMP AL,00H 49 | JNZ TR 50 | JMP READ 51 | 52 | FR: ;First row 53 | MOV ROW,31H 54 | MOV COL,31H 55 | LEA SI,KEYS 56 | 57 | L1: 58 | SHR AL,01H ;shift right until you get column 59 | JC DISPLAY 60 | INC COL 61 | INC SI 62 | JMP L1 63 | 64 | SR: ;Second row 65 | MOV ROW,32H 66 | MOV COL,31H 67 | LEA SI,KEYS+8D 68 | 69 | L2: 70 | SHR AL,01H ;shift right until you get column 71 | JC DISPLAY 72 | INC COL 73 | INC SI 74 | JMP L2 75 | 76 | TR: ;Third row 77 | MOV ROW,33H 78 | MOV COL,31H 79 | LEA SI,KEYS+16D 80 | 81 | L3: 82 | SHR AL,01H ;shift right until you get column 83 | JC DISPLAY 84 | INC COL 85 | INC SI 86 | JMP L3 87 | 88 | DISPLAY: 89 | LEA DX,M3 ;display value 90 | MOV AH,09H 91 | INT 21H 92 | MOV DL,[SI] ;extract character 93 | MOV AH,02H 94 | INT 21H 95 | 96 | LEA DX,M1 ;display row 97 | MOV AH,09H 98 | INT 21H 99 | MOV DL,ROW 100 | MOV AH,02H 101 | INT 21H 102 | 103 | LEA DX,M2 ;display column 104 | MOV AH,09H 105 | INT 21H 106 | MOV DL,COL 107 | MOV AH,02H 108 | INT 21H 109 | 110 | MOV AH,4CH 111 | INT 21H 112 | 113 | END 114 | -------------------------------------------------------------------------------- /IV Semester/Microprocessor_and_Microcontroller_Lab/Part-A/5A_Compare_Two_Strings/5A.asm: -------------------------------------------------------------------------------- 1 | .model small 2 | 3 | .data 4 | msg_1 db 10,13,"Enter 1st String $" ;Entering the first string 5 | buff1 db 100 6 | len1 db ? 7 | str1 db 100 dup(?) 8 | msg_2 db 10,13,'Enter 2nd String $' ;Entering the second string 9 | buff2 db 100 10 | len2 db ? 11 | str2 db 100 dup(?) 12 | msg_len1 db 10,13,'Len of str1 is : $' 13 | msg_len2 db 10,13,'Len of str2 is : $' 14 | msg_s db 10,13,'Strings are equal!$' 15 | msg_ns db 10,13,'Strings are not equal.$' 16 | 17 | .code 18 | mov ax,@data 19 | mov ds,ax 20 | mov es,ax ;cmps works only in extra segment 21 | 22 | lea dx,msg_1 ;Enter string message 23 | call printf 24 | lea dx,buff1 ;Enter string 1 25 | call puts 26 | lea dx,msg_2 27 | call printf 28 | lea dx,buff2 ;enter string 2 29 | call puts 30 | mov al,len1 31 | cmp al,len2 32 | JNE LenNotEqual ;lengths are not equal 33 | 34 | ;comparing 2 strings 35 | mov cx,0000h 36 | mov cl,len1 37 | lea SI,str1 38 | lea DI,str2 39 | CLD 40 | rep cmpsb 41 | JE Str_Equal ;strings are same 42 | 43 | LenNotEqual: 44 | lea DX,msg_ns 45 | call printf 46 | jmp exit 47 | 48 | Str_Equal: lea dx,msg_s 49 | call printf 50 | 51 | exit: 52 | lea dx,msg_len1 ;printing length of string 1 53 | call printf 54 | mov dl,len1 55 | call print_8bit 56 | lea dx,msg_len2 ;printing length of string 2 57 | call printf 58 | mov dl,len2 59 | call print_8bit 60 | mov ah,4ch 61 | int 21h 62 | 63 | ;Procedure for Displaying Message 64 | printf proc near 65 | mov ah,09h 66 | int 21h 67 | ret 68 | printf endp 69 | 70 | ;procedure to enter a string 71 | puts proc near 72 | mov ah,0Ah 73 | int 21h 74 | ret 75 | puts endp 76 | 77 | ;procedure to display 8 bit character in decimal 78 | print_8bit proc near 79 | mov ax,0000h 80 | mov al,dl 81 | mov bx,0010d 82 | mov CX,0000h 83 | Loop_push: 84 | mov DX,0000h 85 | div BX 86 | push DX 87 | inc CX 88 | cmp AX,0000h 89 | JNE Loop_push 90 | Loop_pop: 91 | pop DX 92 | add dx,0030h ;converting the number to ASCII value 93 | mov ah,02h ;character display 94 | int 21h 95 | loop Loop_pop 96 | ret 97 | print_8bit endp 98 | 99 | end -------------------------------------------------------------------------------- /archives/VI Semester/Computer-Graphics/3_ Parallelopiped_Cylinder/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | void draw_pixel(GLint cx,GLint cy) 6 | { 7 | glColor3f(1.0,0.0,0.0); 8 | glBegin(GL_POINTS); 9 | glVertex2f(cx,cy); 10 | glEnd(); 11 | } 12 | 13 | void plot_pixel(GLint h,GLint k,GLint x,GLint y) 14 | { 15 | draw_pixel(x+h,y+k); 16 | draw_pixel(-x+h,y+k); 17 | draw_pixel(x+h,-y+k); 18 | draw_pixel(-x+h,-y+k); 19 | draw_pixel(y+h,x+k); 20 | draw_pixel(-y+h,x+k); 21 | draw_pixel(y+h,-x+k); 22 | draw_pixel(-y+h,-x+k); 23 | } 24 | 25 | void circle_draw(GLint h,GLint k,GLint r) 26 | { 27 | GLint d=1-r, x=0, y=r; 28 | while (y>x) 29 | { 30 | plot_pixel(h,k,x,y); 31 | if(d<0) d+=2*x+3; 32 | else 33 | { 34 | d+=2*(x-y)+5; 35 | --y; 36 | } 37 | ++x; 38 | } 39 | plot_pixel(h,k,x,y); 40 | } 41 | 42 | void cylinder_draw() 43 | { 44 | GLint xc=100,yc=100,r=50; 45 | GLint i,n=50; 46 | for(i=0;i 4 | #include 5 | #include 6 | 7 | //Define Structures 8 | struct sll { 9 | int info; 10 | struct sll * nxt; 11 | }; 12 | 13 | int ch, item; 14 | 15 | //Define Function to insert in the rear 16 | struct sll * insert_rear(struct sll *f) { 17 | struct sll *t, *p; 18 | t = (struct sll * ) malloc(sizeof(struct sll)); 19 | printf("enter the information"); 20 | scanf("%d", &item); 21 | t -> info = item; 22 | t -> nxt = NULL; 23 | if (f == NULL) 24 | return t; 25 | else { 26 | p = f; 27 | while (p -> nxt != NULL) { 28 | p = p -> nxt; 29 | } 30 | p -> nxt = t; 31 | } 32 | return f; 33 | } 34 | 35 | // Function to delete in the rear 36 | struct sll * delete_rear(struct sll *f) { 37 | struct sll *c, *p; 38 | if (f == NULL) { 39 | printf("List Empty"); 40 | return f; 41 | } 42 | if (f -> nxt == NULL) //only one node present 43 | { 44 | printf("Item deleted is %d", f -> info); 45 | free(f); 46 | return NULL; 47 | } 48 | //many nodes so traverse until NULL 49 | p = NULL; 50 | c = f; 51 | while (c -> nxt != NULL) { 52 | p = c; 53 | c = c -> nxt; 54 | } 55 | printf("Item Deleted is %d", c -> info); 56 | free(c); 57 | p -> nxt = NULL; 58 | return f; 59 | } 60 | 61 | //Funtion to display list 62 | void display (struct sll *f) { 63 | struct sll *t; 64 | if (f == NULL) 65 | printf("Empty List"); 66 | t = f; 67 | while (t -> info != NULL) { 68 | printf("%d\t", t -> info); 69 | t = t -> nxt; 70 | } 71 | } 72 | 73 | // Main Function 74 | void main() { 75 | struct sll *f = NULL; 76 | int cou; 77 | clrscr(); 78 | for (;;) { 79 | printf("\n1.PUSH \n2.POP\n3.Display\n 4..Exit\n"); 80 | printf("Enter choice"); 81 | scanf("%d", &ch); 82 | switch (ch) { 83 | case 1: 84 | f = insert_rear(f); 85 | break; 86 | case 2: 87 | f = delete_rear(f); 88 | break; 89 | case 3: 90 | display(f); 91 | break; 92 | default: 93 | exit(0); 94 | } 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /III Semester/Data-Structure-in-C/README.md: -------------------------------------------------------------------------------- 1 | # Data-Structure-in-C-Lab 2 | This repository contains all the Data structure in C Lab's program in the Autonomous curriculum of Dayananda Sagar College of Engineering. 3 | 4 | ## Getting Started 5 | Several options are available to get started: 6 | * Clone the repo at `git clone https://github.com/rishabhlakhotia/CSE-Lab-Manual` 7 | * Fork the repository if you think you can contribute back 8 | 9 | ## List of the programs 10 | 1. Write a C program to find best of two elements from an array using pointers. 11 | 12 | 2. Write an algorithm to create a student database using structure with following fields: USN, Name and Semester for 10 students and sort it according to USN using bubble sort. 13 | 14 | 3. Design, develop and execute a program in C to read a sparse matrix of integer values and to search the sparse matrix for an element specified by the user. 15 | 16 | 4. Design, develop and execute a program in C to convert a given parenthesized infix arithmetic expression to postfix expression and then print both the expressions. The expression consists of single character operands and the binary operators +, -, \*, /. 17 | 18 | 5. Design a C program to evaluate a valid postfix expression using stack. 19 | 20 | 6. Design a C program to simulate the working of a queue of integers using an array. Provide the following operations: 21 | * Insert 22 | * Delete 23 | * Display 24 | 25 | 7. Design a C program to perform following operations on Singly Linked List 26 | * Insert the node at the beginning 27 | * Insert the node at the end of the List 28 | * Display the List 29 | 30 | 8. Write a C Program to implement Singly Linked List using stack principles. 31 | 32 | 9. Design a C Program to implement a double linked list where each node consists of integers. 33 | 34 | 10. Design a C Program to create a max heap of integers by accepting one element at a time and by inserting it immediately in to the heap. Use the array representation for the heap. Finally display the heap. 35 | 36 | 11. Design a C program to create a Binary Search Tree and perform the following operations 37 | * In-Order Traversal 38 | * Pre-Order Traversal 39 | * Post-Order Traversal 40 | 41 | 12. Write a C program to construct a BST for the given array elements and display the elements using the array indexing. 42 | 43 | ## Contributing 44 | If you're having problems, or have a suggestion, please log and issue on GitHub. If you'd like to have a crack yourself, fork the repository and make a pull request. 45 | -------------------------------------------------------------------------------- /III Semester/Data-Structure-in-C/4. Infix_to_Postfix/INTOPOST.C: -------------------------------------------------------------------------------- 1 | // Program to convert the given infix expression to a postfix expression 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | char stack[50]; 8 | int top = -1; 9 | 10 | void push(char x) { 11 | stack[++top] = x; 12 | } 13 | 14 | int pop() { 15 | return (stack[top--]); 16 | } 17 | 18 | /* Function assigns priority to each Symbol encountered, with 2 being lowest and 4 being highest, 19 | 1 is a special case for parenthesis */ 20 | int prior(char x) { 21 | int p; 22 | if (x == '(' || x == '#') p = 1; 23 | if (x == '+' || x == '-') p = 2; 24 | if (x == '*' || x == '/') p = 3; 25 | if (x == '^' || x == '$') p = 4; 26 | return p; 27 | } 28 | 29 | void main() { 30 | char infix[20], postfix[20]; 31 | int i, j = 0, l; 32 | 33 | clrscr(); 34 | 35 | // Getting the infix expression 36 | printf("Enter the infix expression: "); 37 | gets(infix); 38 | push('#'); 39 | 40 | // Convert to postfix 41 | l = strlen(infix); 42 | for (i = 0; i < l; i++) { 43 | 44 | // if numbers/characters are encountered, directly add them to the postfix 45 | if (isalnum(infix[i])) 46 | postfix[j++] = infix[i]; 47 | 48 | // if opening parenthesis is encountered, push it into the stack 49 | else if (infix[i] == '(') 50 | push(infix[i]); 51 | 52 | // if closing parenthesis is encountered, pop all elements in the stack into the postfix 53 | // till the opening parenthesis is not found and popped 54 | else if (infix[i] == ')') { 55 | while (stack[top] != '(') 56 | postfix[j++] = pop(); 57 | pop(); 58 | } 59 | 60 | /* if operators are encountered, check the priority, keep 61 | popping if the priority of the top element of the stack 62 | is greater than the priority of the current operator and 63 | then push the operator into the stack */ 64 | else { 65 | while (prior(stack[top]) >= prior(infix[i])) 66 | postfix[j++] = pop(); 67 | push(infix[i]); 68 | } 69 | } 70 | 71 | //Final step, Keep popping till you see your little marker that we used i.e the # sign! 72 | while (stack[top] != '#') 73 | postfix[j++] = pop(); 74 | postfix[j] = '\0'; 75 | 76 | //You now have your postfix expression and can now print it 77 | printf("\nPostfix expression is: "); 78 | puts(postfix); 79 | getch(); 80 | } 81 | -------------------------------------------------------------------------------- /IV Semester/Microprocessor_and_Microcontroller_Lab/Part-A/6B_Elevator_Interface/6B.asm: -------------------------------------------------------------------------------- 1 | .MODEL SMALL 2 | .DATA 3 | 4 | PA EQU 0D800H 5 | PB EQU 0D801H 6 | PC EQU 0D802H 7 | CW EQU 0D803H 8 | 9 | CLEAR DB 0E0H,0D0H,0B0H,70H 10 | ;Ports PA7-PA4 11 | ;GF 1110 12 | ;FF 1101 13 | ;SF 1011 14 | ;TF 0111 15 | 16 | .CODE 17 | MOV AX,@DATA 18 | MOV DS,AX 19 | 20 | MOV DX,CW 21 | MOV AL,82H ;port B is Input 22 | OUT DX,AL 23 | 24 | LEA SI,CLEAR 25 | MOV AL,0F0H ;clear SR flip flop PA4-PA7 26 | MOV DX,PA 27 | OUT DX,AL 28 | 29 | NOREQ: 30 | CALL REQUEST ;read input from Elevator Key 31 | JZ NOREQ 32 | 33 | SHR AL,01H ;1110 ground 34 | JNC GF 35 | SHR AL,01H ;1101 first 36 | JNC FF 37 | SHR AL,01H ;1011 second 38 | JNC SF 39 | JMP TF ;0111 third 40 | 41 | GF: 42 | CALL DELAY 43 | CALL RESET ;stays at Ground floor 44 | JMP EXIT 45 | 46 | FF: 47 | MOV CX,03H ;initialize counter to 3 48 | CALL MOVEUP 49 | 50 | PUSH AX ;store ax = 1111 0011, al = 3 51 | CALL DELAY 52 | INC SI ;si points to FF = 1101 53 | CALL RESET ;stay at that floor 54 | MOV CX,03H ;initialize counter to 3 again to move down 55 | POP AX 56 | 57 | CALL MOVEDOWN 58 | JMP EXIT 59 | 60 | SF: 61 | MOV CX,06H 62 | CALL MOVEUP 63 | PUSH AX 64 | CALL DELAY 65 | ADD SI,02 66 | CALL RESET 67 | MOV CX,06H 68 | POP AX 69 | CALL MOVEDOWN 70 | JMP EXIT 71 | 72 | TF: 73 | MOV CX,09H 74 | CALL MOVEUP 75 | PUSH AX 76 | CALL DELAY 77 | ADD SI,03H 78 | CALL RESET 79 | MOV CX,09H 80 | POP AX 81 | CALL MOVEDOWN 82 | JMP EXIT 83 | 84 | EXIT: 85 | MOV AH,4CH 86 | INT 21H 87 | ;_______________________________________ 88 | 89 | REQUEST PROC NEAR 90 | MOV DX,PB ;read from Port B 91 | IN AL,DX 92 | AND AL,0FH 93 | CMP AL,0FH 94 | RET 95 | REQUEST ENDP 96 | 97 | RESET PROC NEAR ;out SI to port A 98 | MOV DX,PA 99 | MOV AL,[SI] 100 | OUT DX,AL 101 | RET 102 | RESET ENDP 103 | 104 | MOVEUP PROC NEAR ;out AL to port A 105 | MOV DX,PA 106 | MOV AL,0F0H 107 | L1: 108 | OUT DX,AL 109 | CALL DELAY 110 | INC AL 111 | LOOP L1 112 | OUT DX,AL 113 | RET 114 | MOVEUP ENDP 115 | 116 | MOVEDOWN PROC NEAR ;out AL to port A 117 | MOV DX,PA 118 | L2: 119 | OUT DX,AL 120 | CALL DELAY 121 | DEC AL 122 | LOOP L2 123 | OUT DX,AL 124 | RET 125 | MOVEDOWN ENDP 126 | 127 | DELAY PROC NEAR 128 | PUSH SI 129 | PUSH DI 130 | 131 | MOV SI,0FFFFH 132 | Outer: 133 | MOV DI,0FFFFH 134 | Inner: 135 | DEC DI 136 | JNZ Inner 137 | DEC SI 138 | JNZ Outer 139 | 140 | POP DI 141 | POP SI 142 | RET 143 | DELAY ENDP 144 | 145 | END 146 | -------------------------------------------------------------------------------- /I & II Semester/Programming-in-C/README.md: -------------------------------------------------------------------------------- 1 | # Programming-in-C-Lab 2 | This repository contains all the Programming in C Lab's program in the Autonomous curriculum of Dayananda Sagar College of Engineering. 3 | 4 | ## Getting Started 5 | Several options are available to get started: 6 | * Clone the repo at `git clone https://github.com/rishabhlakhotia/CSE-Lab-Manual` 7 | * Fork the repository if you think you can contribute back 8 | 9 | ## List of Programs 10 | 1. Design and develop a C program for the following: 11 | * To read a year as an input and find wether it is leap year or not.(Consider the end of centuries). 12 | * To find the largest of three numbers using Ternary operators. 13 | 14 | 2. Design and develop a C program that accepts three non coefficients(a, b and c) of a Quadratic equation (ax^2+bx+c=0) as input and compute all possible roots and print the possible roots for a given set of coefficients. 15 | 16 | 3. Design and develop a C programs to find the reverse of an integer number NUM and check wether it is PALINDROME or NOT. Implement a C program for the developed algorithm that takes an integer number as input and output the reverse of the same with suitable messages. Ex: Num:1234,Reverse:4321,Not a Palindrome. 17 | 18 | 4. Design and develop a C program that read N integer numbers and arrange them in ascending order using BUBBLE SORT. 19 | 20 | 5. Design and develop a C program that reads N integer numbers and search a key element using BINARY SEARCH TECHNIQUE. 21 | 22 | 6. Design and develop a C program that reads two matrices A (m*n) and B (p*q) and Compute product of the matrices A and B. Read matrix A and matrix B in row major order. Print both the input matrices and resultant matrix appropriately. 23 | 24 | 7. Design and develop a C program to implement the following operations without using library functions. Display the results after every operation. 25 | Read STRING s1="Dayananda" 26 | Read STRING s2="Sagar" 27 | Output the concatenated string (s1+s2) STRING s3="Dayananda Sagar" 28 | 29 | 8. Design and develop a C function isprime(num) that accepts an integer argument and returns 1 if the argument is prime, ) otherwise. Write a C program that invokes this function to generate prime numbers between the given ranges. 30 | 31 | 9. Design and develop a C program to create a structure called Employee to maintain a record of details using an array of structures with four fields(Emp_name, Emp_id, Emd-sal, Emp_age). Assume appropriate data type for each field.Print the Employee details in Tabular Format. 32 | 33 | 10. Write a C program using pointers to compute the sum, mean and standard deviation of all elements in an array of n real numbers. 34 | 35 | ## Contributing 36 | If you're having problems, or have a suggestion, please log and issue on GitHub. If you'd like to have a crack yourself, fork the repository and make a pull request. 37 | -------------------------------------------------------------------------------- /III Semester/OOPS-With-Java/6. Abstract-Class/MySolid.java: -------------------------------------------------------------------------------- 1 | import java.util.*; 2 | 3 | abstract class Solid 4 | { 5 | double radius; 6 | 7 | public abstract void surfaceArea(); 8 | public abstract void volume(); 9 | public abstract void readRadius(); 10 | 11 | public double baseArea(double r) 12 | { 13 | double p; 14 | p=Math.PI*r*r; 15 | return(p); 16 | } 17 | } 18 | 19 | class Cylinder extends Solid 20 | { 21 | double height; 22 | public Cylinder(double h) 23 | { 24 | height=h; 25 | } 26 | 27 | 28 | public void readRadius() 29 | { 30 | Scanner sc=new Scanner(System.in); 31 | System.out.println("Enter the radius of cylinder"); 32 | radius=sc.nextDouble(); 33 | } 34 | 35 | public void surfaceArea() 36 | { 37 | double bArea; 38 | double totalArea; 39 | bArea=baseArea(radius); 40 | totalArea=2*Math.PI*radius*height+2*bArea; 41 | System.out.println("Surface area of cylinder is"+totalArea); 42 | } 43 | 44 | public void volume() 45 | { 46 | System.out.println("\nVolume of the cylinder is"+height*(baseArea(radius))); 47 | } 48 | } 49 | 50 | 51 | class Cone extends Solid 52 | { 53 | double height; 54 | 55 | public Cone(double h) 56 | { 57 | height=h; 58 | } 59 | 60 | public void readRadius() 61 | { 62 | Scanner sc=new Scanner(System.in); 63 | System.out.println("Enter the radius of cone: "); 64 | radius=sc.nextDouble(); 65 | } 66 | 67 | public void surfaceArea() 68 | { 69 | double area; 70 | double slantHeight; 71 | 72 | slantHeight=Math.sqrt(radius*radius+height*height); 73 | area=(Math.PI*radius)*(radius+slantHeight); 74 | System.out.println("Surface area of a cone is: "+area); 75 | } 76 | 77 | public void volume() 78 | { 79 | double volume; 80 | volume=(1.0/3)*(baseArea(radius))*height; 81 | System.out.println("Volume of cone is:"+volume); 82 | } 83 | } 84 | 85 | class Sphere extends Solid 86 | { 87 | public void readRadius() 88 | { 89 | Scanner sc=new Scanner(System.in); 90 | System.out.println("Enter the radius of sphere"); 91 | radius=sc.nextDouble(); 92 | } 93 | 94 | 95 | public void surfaceArea() 96 | { 97 | System.out.println("Surface area of a sphere is: "+4*baseArea(radius)); 98 | 99 | } 100 | 101 | public void volume() 102 | { 103 | double volume; 104 | volume=(4.0/3)*(baseArea(radius))*radius; 105 | System.out.println("Volume of cone is:"+volume); 106 | } 107 | } 108 | 109 | class MySolid 110 | { 111 | public static void main(String args[]) 112 | { 113 | Solid s=new Cylinder(7); 114 | s.readRadius(); 115 | s.surfaceArea(); 116 | s.volume(); 117 | 118 | s=new Cone(7); 119 | s.readRadius(); 120 | s.surfaceArea(); 121 | s.volume(); 122 | 123 | s=new Sphere(); 124 | s.readRadius(); 125 | s.surfaceArea(); 126 | s.volume(); 127 | } 128 | } 129 | -------------------------------------------------------------------------------- /III Semester/OOPS-With-Java/4. Bitwise-Operations/README.md: -------------------------------------------------------------------------------- 1 | ## Expected Output 2 | 3 | Enter value for x: 4 | 5 | 4 6 | 7 | 8 | 9 | Enter value for y: 10 | 11 | 2 12 | 13 | ********************** 14 | 15 | 1.Bitwise AND 16 | 17 | 2.Bitwise OR 18 | 19 | 3.Bitwise XOR 20 | 21 | 4.Bitwise LEFT SHIFT 22 | 23 | 5.Bitwise RIGHT SHIFT 24 | 25 | 6.Bitwise NOT 26 | 27 | 7.EXIT 28 | 29 | *********************** 30 | 31 | enter your choice: 32 | 33 | 1 34 | 35 | Bitwise AND OPERATION:0 36 | 37 | ********************** 38 | 39 | 1.Bitwise AND 40 | 41 | 2.Bitwise OR 42 | 43 | 3.Bitwise XOR 44 | 45 | 4.Bitwise LEFT SHIFT 46 | 47 | 5.Bitwise RIGHT SHIFT 48 | 49 | 6.Bitwise NOT 50 | 51 | 7.EXIT 52 | 53 | *********************** 54 | 55 | enter your choice: 56 | 57 | 2 58 | 59 | Bitwise OR OPERATION:6 60 | 61 | ********************** 62 | 63 | 1.Bitwise AND 64 | 65 | 2.Bitwise OR 66 | 67 | 3.Bitwise XOR 68 | 69 | 4.Bitwise LEFT SHIFT 70 | 71 | 5.Bitwise RIGHT SHIFT 72 | 73 | 6.Bitwise NOT 74 | 75 | 7.EXIT 76 | 77 | *********************** 78 | 79 | enter your choice: 80 | 81 | 3 82 | 83 | Bitwise XOR OPERATION:6 84 | 85 | ********************** 86 | 87 | 1.Bitwise AND 88 | 89 | 2.Bitwise OR 90 | 91 | 3.Bitwise XOR 92 | 93 | 4.Bitwise LEFT SHIFT 94 | 95 | 5.Bitwise RIGHT SHIFT 96 | 97 | 6.Bitwise NOT 98 | 99 | 7.EXIT 100 | 101 | *********************** 102 | 103 | enter your choice: 104 | 105 | 4 106 | 107 | LEFT SHIFT:16 108 | 109 | ********************** 110 | 111 | 1.Bitwise AND 112 | 113 | 2.Bitwise OR 114 | 115 | 3.Bitwise XOR 116 | 117 | 4.Bitwise LEFT SHIFT 118 | 119 | 5.Bitwise RIGHT SHIFT 120 | 121 | 6.Bitwise NOT 122 | 123 | 7.EXIT 124 | 125 | *********************** 126 | 127 | enter your choice: 128 | 129 | 5 130 | 131 | RIGHT SHIFT:1 132 | 133 | ********************** 134 | 135 | 1.Bitwise AND 136 | 137 | 2.Bitwise OR 138 | 139 | 3.Bitwise XOR 140 | 141 | 4.Bitwise LEFT SHIFT 142 | 143 | 5.Bitwise RIGHT SHIFT 144 | 145 | 6.Bitwise NOT 146 | 147 | 7.EXIT 148 | 149 | *********************** 150 | 151 | enter your choice: 152 | 153 | 6 154 | 155 | NOT of x :-5 156 | 157 | NOT of y :-3 158 | 159 | ********************** 160 | 161 | 1.Bitwise AND 162 | 163 | 2.Bitwise OR 164 | 165 | 3.Bitwise XOR 166 | 167 | 4.Bitwise LEFT SHIFT 168 | 169 | 5.Bitwise RIGHT SHIFT 170 | 171 | 6.Bitwise NOT 172 | 173 | 7.EXIT 174 | 175 | *********************** 176 | 177 | enter your choice: 178 | 179 | 8 180 | 181 | Invalid chioce, Please enter the correct choice 182 | 183 | ********************** 184 | 185 | 1.Bitwise AND 186 | 187 | 2.Bitwise OR 188 | 189 | 3.Bitwise XOR 190 | 191 | 4.Bitwise LEFT SHIFT 192 | 193 | 5.Bitwise RIGHT SHIFT 194 | 195 | 6.Bitwise NOT 196 | 197 | 7.EXIT 198 | 199 | *********************** 200 | 201 | enter your choice: 202 | 203 | 7 204 | 205 | Thankyou 206 | -------------------------------------------------------------------------------- /archives/VI Semester/Computer-Graphics/7_Color_Cube_Movement/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | GLfloat vertices[ ]={ -1.0,-1.0,-1.0, 6 | 1.0,-1.0,-1.0, 7 | 1.0, 1.0,-1.0, 8 | - 1.0, 1.0,-1.0, 9 | - 1.0,-1.0, 1.0, 10 | 1.0,-1.0, 1.0, 11 | 1.0, 1.0, 1.0, 12 | -1.0, 1.0, 1.0 }; 13 | 14 | GLfloat normals[ ]={ -1.0,-1.0,-1.0, 15 | 1.0,-1.0,-1.0, 16 | 1.0, 1.0,-1.0, 17 | -1.0, 1.0,-1.0, 18 | -1.0,-1.0, 1.0, 19 | 1.0,-1.0, 1.0, 20 | 1.0, 1.0, 1.0, 21 | -1.0, 1.0, 1.0 }; 22 | 23 | GLfloat colors[ ]={ 0.0,0.0,0.0, 24 | 1.0, 0.0, 0.0, 25 | 1.0, 1.0, 0.0, 26 | 0.0, 1.0, 0.0, 27 | 0.0, 0.0, 1.0, 28 | 1.0, 0.0, 1.0, 29 | 1.0, 1.0, 1.0, 30 | 0.0, 1.0, 1.0}; 31 | 32 | GLubyte cubeIndices[]={0,3,2,1, 33 | 2,3,7,6, 34 | 0,4,7,3, 35 | 1,2,6,5, 36 | 4,5,6,7, 37 | 0,1,5,4 }; 38 | 39 | static GLfloat theta[]={0.0,0.0,0.0}; 40 | 41 | static GLint axis=2; 42 | 43 | void display(void) { 44 | glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT); 45 | glLoadIdentity(); 46 | glRotatef(theta[0],1.0,0.0,0.0); 47 | glRotatef(theta[1],0.0,1.0,0.0); 48 | glRotatef(theta[2],0.0,0.0,1.0); 49 | glDrawElements(GL_QUADS,24,GL_UNSIGNED_BYTE,cubeIndices); 50 | glFlush(); 51 | glutSwapBuffers(); 52 | } 53 | 54 | void mouse(int btn,int state,int x,int y) 55 | { 56 | if(btn==GLUT_LEFT_BUTTON && state==GLUT_DOWN)axis=0; 57 | if(btn==GLUT_RIGHT_BUTTON && state==GLUT_DOWN) axis=1; 58 | if(btn==GLUT_MIDDLE_BUTTON && state==GLUT_DOWN) axis=2; 59 | } 60 | 61 | void spincube() 62 | { 63 | theta[axis]+=2.0; 64 | if(theta[axis]>360.0) theta[axis]-=360.0; 65 | glutPostRedisplay(); 66 | } 67 | 68 | void myReshape(int w,int h) 69 | { 70 | glViewport(0,0,w,h); 71 | glMatrixMode(GL_PROJECTION); 72 | glLoadIdentity(); 73 | if(w<=h) 74 | glOrtho(-2.0,2.0,-2.0*(GLfloat)h/(GLfloat)w,2.0*(GLfloat)h/(GLfloat)w,10.0,10.0); 75 | else 76 | glOrtho(-2.0*(GLfloat)w/(GLfloat)h,2.0*(GLfloat)w/(GLfloat)h,-2.0,2.0,-10.0,10.0); 77 | glMatrixMode(GL_MODELVIEW); 78 | } 79 | 80 | void main(int argc,char **argv) 81 | { 82 | glutInit(&argc,argv); 83 | glutInitDisplayMode(GLUT_DOUBLE|GLUT_RGB|GLUT_DEPTH); 84 | glutInitWindowSize(500,500); 85 | glutCreateWindow("color cube"); 86 | glutReshapeFunc(myReshape); 87 | glutDisplayFunc(display); 88 | glutMouseFunc(mouse); 89 | glutIdleFunc(spincube); 90 | glEnable(GL_DEPTH_TEST); 91 | glEnableClientState(GL_COLOR_ARRAY); 92 | glEnableClientState(GL_VERTEX_ARRAY); 93 | glEnableClientState(GL_NORMAL_ARRAY); 94 | glVertexPointer(3,GL_FLOAT,0,vertices); 95 | glColorPointer(3,GL_FLOAT,0,colors); 96 | glNormalPointer(GL_FLOAT,0,normals); 97 | glColor3f(1.0,1.0,1.0); 98 | glutMainLoop(); 99 | } 100 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![GitHub license](https://img.shields.io/github/license/rishabhlakhotia/CSE-Lab-Manual.svg)](https://github.com/rishabhlakhotia/CSE-Lab-Manual/blob/master/LICENSE) 2 | [![GitHub stars](https://img.shields.io/github/stars/rishabhlakhotia/CSE-Lab-Manual.svg?style=social&label=Star&maxAge=2592000)](https://GitHub.com/rishabhlakhotia/CSE-Lab-Manual/stargazers/) 3 | [![GitHub forks](https://img.shields.io/github/forks/rishabhlakhotia/CSE-Lab-Manual.svg?style=social&label=Fork&maxAge=2592000)](https://GitHub.com/rishabhlakhotia/CSE-Lab-Manual/network/) 4 | [![GitHub contributors](https://img.shields.io/github/contributors/rishabhlakhotia/CSE-Lab-Manual.svg)](https://GitHub.com/rishabhlakhotia/CSE-Lab-Manual/graphs/contributors/) 5 | [![HitCount](http://hits.dwyl.com/rishabhlakhotia/CSE-Lab-Manual.svg)](http://hits.dwyl.com/rishabhlakhotia/CSE-Lab-Manual) 6 | 7 | # CSE Lab Manual 8 | This repsitory contains all the Lab programs encountered in the Autonomous curriculum of Dayananda Sagar College of Engineering. 9 | 10 | ## Getting Started 11 | Several options are available to get started: 12 | * Clone the repo at `git clone https://github.com/rishabhlakhotia/CSE-Lab-Manual` 13 | * Fork the repository if you think you can contribute back 14 | 15 | ## Source 16 | All the codes in this repo are inspired from the Autonomous curriculum of Dayananda Sagar College of Engineering of different practical courses through the semesters. 17 | 18 | ## List of Labs in this Repository 19 | 1. I & II Semester 20 | * [Programming in C Lab](/I%20%26%20II%20Semester/Programming-in-C) 21 | 22 | 2. III Semester 23 | * [Data Structure in C Lab](/III%20Semester/Data-Structure-in-C) 24 | * [OOPS with Java Lab](/III%20Semester/OOPS-With-Java) 25 | 26 | 3. IV Semester 27 | * [Design and Analysis of Algorithm Lab](/IV%20Semester/ADA_Lab) 28 | * [Microprocessor and Microcontroller Lab](/IV%20Semester/Microprocessor_and_Microcontroller_Lab) 29 | 30 | 4. V Semester 31 | * [Database Management System Lab](/V%20Semester/Database-Management-System) 32 | * [Computer Networks Lab](/V%20Semester/Computer-Networks) 33 | 34 | 5. VI Semester 35 | * [Internet and Web Technologies Lab](/VI%20Semester/Internet-and-Web-Technologies) 36 | * [Computer Graphics Lab](/VI%20Semester/Computer-Graphics) 37 | 38 | 39 | ## Contributors 40 | 1. Rishabh Lakhotia ([GitHub](https://github.com/rishabhlakhotia)) 41 | 1. Siddharth Singh ([GitHub](https://github.com/cddharthsingh)) 42 | 1. Rewant Soni ([GitHub](https://github.com/rewantsoni)) 43 | 1. Mohammad Ataaur Rahman ([Github](https://github.com/Ataago)) 44 | 1. Anush DP ([GitHub](https://github.com/Anush-DP)) 45 | 1. Navneeth ([GitHub](https://github.com/navneeeth)) 46 | 47 | *Disclaimer: We may have changed some of the codes for better functionality.* 48 | 49 | ## Contributing 50 | If you're having problems, or have a suggestion, please log and issue on GitHub. If you'd like to have a crack yourself, fork the repository and make a pull request. 51 | -------------------------------------------------------------------------------- /archives/VI Semester/Internet-and-Web-Technologies/5_XML_XSLT/5b.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ABC 6 | 1DS09CS761 7 | CSE 8 | DSCE 9 | 10 | 11 |
12 | 13 | 14 | DEF 15 | 1DS09CS662 16 | CSE 17 | DSCE 18 | 19 | 20 |
21 | 22 | 23 | GHI 24 | 1DS09CS092 25 | ISE 26 | DSCE 27 | 28 |
29 | 30 | 31 | stud.xsl 32 | 33 | 34 | 35 | 36 | 37 | 38 |

VTU STUDENTS INFORMATION

39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 54 | 57 | 60 | 63 | 64 | 65 | 66 | 67 | 68 | 71 | 74 | 77 | 80 | 81 | 82 | 83 | 84 |
NAMEUSNBRANCHCOLLEGE
52 | 53 | 55 | 56 | 58 | 59 | 61 | 62 |
69 | 70 | 72 | 73 | 75 | 76 | 78 | 79 |
85 | 86 | Selected Student Information 87 | 88 | 89 |
90 |
91 | --------------------------------------------------------------------------------