This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#problem-1 | |
#process breakdown | |
#divide the number by 1 - so we get the number of steps required in total if only 1 step is followed | |
#scenario for 1 step | |
n = 3 | |
s1 = int(n/1) | |
# print(s1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Add new column in database which is foreign key | |
ALTER TABLE database.table | |
ADD COLUMN columnname INT DEFAULT(1), | |
ADD FOREIGN KEY fk_name(fk_column) REFERENCES reftable(refcolumn) ON DELETE CASCADE; | |
--create table | |
CREATE TABLE IF NOT EXISTS checklists ( | |
todo_id INT AUTO_INCREMENT, | |
task_id INT, | |
todo VARCHAR(255) NOT NULL, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--Tutorial Link - https://www.mysqltutorial.org/mysql-stored-procedure-tutorial.aspx/ | |
-- | |
--CREATE PROCEDURE | |
-- | |
DELIMITER // | |
CREATE PROCEDURE procedure_name(parameter_list) | |
BEGIN |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package javalab02; | |
import java.util.Scanner; | |
public class JavaLab02 { | |
public static int findProfit(int i, int c, int w[], int v[], int n){ | |
if(i==n||c==0){ | |
return 0; | |
}else if(w[i]<=c){ | |
int x1 = v[i] + findProfit(i+1,c-w[i], w, v, n); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package javalab; | |
import java.util.Scanner; | |
public class JavaLab { | |
char X[]; | |
char Y[]; | |
int l1,l2; | |
int c[][]; | |
int b[][]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class MaxMinDC { | |
static Scanner sc = new Scanner(System.in); | |
static int max = Integer.MIN_VALUE, min = Integer.MAX_VALUE; | |
static int a[]; | |
static int size; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class MergeSort { | |
static Scanner sc = new Scanner(System.in); | |
static int size; | |
static int a[]; | |
static int b[]; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class QuickSort | |
{ | |
static Scanner sc = new Scanner(System.in); | |
static int size; | |
public static int arr[]; | |
public static void sort(int arr[], int low, int high) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
int main() | |
{ | |
float x,y,z; | |
printf("enter the three angles:"); | |
scanf("%f%f%f",&x,&y,&z); | |
if(x+y+z<=180) | |
printf("triangle is valid"); | |
else | |
printf("triangle is not valid"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
int main() | |
{ | |
int n; | |
printf("enter the number:"); | |
scanf("%d",&n); | |
printf("unit place:%d",n%10); | |
printf("\nten's place:%d",(n/10)%10); | |
return 0; | |
} |
NewerOlder