Python program to execute network basic commands

Program: import subprocess def ping(): host = input("Enter Host: ") packet = int(input("\nEnter Packet: ")) print("\n") ping = subprocess.getoutput(f"ping -w {packet} {host}") print(ping) def tracert(): host = input("Enter Host: ") print("\n") trace = subprocess.getoutput(f"tracert {host}") print(trace) def ipconfig(): ip = subprocess.getoutput(f"ipconfig") print(ip) def netstat(): net = subprocess.getoutput(f"netstat") print(net) def nslookup(): host = input("Enter Host: ") … Continue reading Python program to execute network basic commands

Display Maximum number in c

Algorithm: Start the programGet two numbers from userStored the numbers in num1 & num1If num1 is greater than num2 then num1 is maximum.Else num2 is greaterDisplay the maximum number in outputStop the program Program: #include <stdio.h>int main(){ int num1, num2; printf("Enter two numbers: "); scanf("%d%d", &num1, &num2); if(num1 > num2) { printf("%d is maximum", num1); … Continue reading Display Maximum number in c

Implement pipe concept in Inter Process Communication using C program

Algorithm: 1.      create the pipe and create the process. 2.      get the input in the main process and pass the output to the child process using pipe. 3.      perform the operation given in the child process and print the output. 4.      stop the program. Program: #include<stdio.h> #include<unistd.h> #include<string.h> int main() { int p1[2],p2[2],p3[2],p4[2]; int i,j=0,k=0,l=0; … Continue reading Implement pipe concept in Inter Process Communication using C program

Round Robin Scheduling

Program: #include <stdio.h> int main() { int i,x=-1,k[10],m=0,n,t,s=0; int a[50],temp,b[50],p[10],bur[10],bur1[10]; int wat[10],tur[10],ttur=0,twat=0,j=0; float awat,atur; printf("Enter no. of process : "); scanf("%d", &n); for(i=0; i<n; i++) { printf("Burst time for process P%d : ", (i+1)); scanf("%d", &bur[i]); bur1[i] = bur[i]; } printf("Enter the time slice (in ms) : "); scanf("%d", &t); for(i=0; i<n; i++) { b[i] … Continue reading Round Robin Scheduling

Graphene Battery

Graphene is a composition of carbon atoms tightly bound in a hexagonal or honeycomb-like structure. What makes graphene so unique is that this structure is just one atomic layer thick, essentially making a graphene sheet two-dimensional. This 2D structure produces very interesting properties, including excellent electrical and thermal conductivity, high flexibility, high strength, and low … Continue reading Graphene Battery