Skip to content

Instantly share code, notes, and snippets.

View iamrush3r's full-sized avatar

iamrush3r

View GitHub Profile
#include<stdio.h>
int main()
{
int i,n,p[10]={1,2,3,4,5,6,7,8,9,10},min,k=1,btime=0;
int bt[10],temp,j,at[10],wt[10],tt[10],ta=0,sum=0;
float wavg=0,tavg=0,tsum=0,wsum=0;
printf(" -------Shortest Job First Scheduling ( NP )-------\n");
printf("\nEnter the No. of processes :");
scanf("%d",&n);
@iamrush3r
iamrush3r / YoutubePlaylistLength.js
Created December 22, 2019 12:08
Calculate the total playtime length of a youtube playlist.
/**
USAGE
1. Open the playlist you want
//Make sure to add a &disable_polymer=true in the URL
2. Right click > Inspect element > Console
3. Copy this and paste. Hit enter.
4. For watch later make sure to click the Edit button
EDIT: Not all playlists have hours.
*/
HTML File:
<html>
<body>
<form method="GET" action="ass1a1.php">
Enter the String : <input type="text" name="inputStr"><br>
<input type="submit" name="Submit">
</form>
</body>
</html>
#include <stdio.h>
#include <math.h>
int main()
{
float radius, height;
float surface_area, volume;
printf("Enter value for radius and height of a cylinder : \n");
scanf("%f%f", &radius, &height);
surface_area = 2 * (22 / 7) * radius * (radius + height);
volume = (22 / 7) * radius * radius * height;
#include<stdio.h>
void main()
{
int sec;
float distance , initial_velocity,velocity, acceleration;
printf("Enter the time in seconds \n");
scanf("%d",&sec);
printf("Enter the initial velocity \n");
scanf("%f", &initial_velocity);
printf("Enter the acceleration \n");
# Python3 program to add two numbers
number1 = input("First number: ")
number2 = input("\nSecond number: ")
# Adding two numbers
# User might also enter float numbers
sum = float(number1) + float(number2)
# Display the sum
# Python3 program to add two numbers
number1 = input("First number: ")
number2 = input("\nSecond number: ")
# Adding two numbers
# User might also enter float numbers
sum = float(number1) + float(number2)
# Display the sum
# factorial of given number
def factorial(n):
# single line to find factorial
return 1 if (n==1 or n==0) else n * factorial(n - 1)
# Driver Code
num = 5
# Python3 program to find simple interest
# for given principal amount, time and
# rate of interest.
# We can change values here for
# different inputs
P = 1
R = 1
T = 1
# Python program to print all
# prime number in an interval
start = 11
end = 25
for val in range(start, end + 1):
# If num is divisible by any number
# between 2 and val, it is not prime