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
Author: Shanthosh Lakshman
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
C program for tower for hanoi
Algorithm: Start the programOnly one disk can be moved at a time.Each move consists of taking the upper disk from one of the stacks and placing it on top of another stack i.e. a disk can only be moved if it is the uppermost disk on a stack.No disk may be placed on top of … Continue reading C program for tower for hanoi
Factorial of a Number Using Recursion
Algorithm: Start programAsk the user to enter an integer to find the factorialRead the integer and assign it to a variableFrom the value of the integer up to 1, multiply each digit and update the final valueThe final value at the end of all the multiplication till 1 is the factorialStop the program Program: #include<stdio.h>long … Continue reading Factorial of a Number Using Recursion
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
Shell program to find the sum of n numbers
Program: sum=0 i=1 echo "Enter the number of terms:" read n echo "Enter the numbers:" while [ $i -le $n ] do read a sum=`expr $a + $sum` i=`expr $i + 1` done echo "Sum is $sum" Output: chmod +x {filename.sh} ./filename.sh Enter the number of terms: 5 Enter the numbers: 1 2 3 4 … Continue reading Shell program to find the sum of n numbers
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
Decision making and branching in C
In C programming it support sequential program statements which execute one statement immediately after another. Here the flow is sequential it never change the flow of control from the next line. The compiler executes the program sequentially in the order which they appear. This happens when there are no options and if the repeated steps … Continue reading Decision making and branching in C
What is Human Gene Editing?
Genome editing is a way of making changes to specific parts of a genome. Scientists have been able to alter DNA since the 1970s, but in recent years, they have developed faster, cheaper, and more precise methods to add, remove, or change genes in living organisms. Researchers are working to develop therapies that use gene … Continue reading What is Human Gene Editing?
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