This file contains 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
/** | |
@Author: Nasir Islam Sujan | |
@Github: https://github.com/78526Nasir | |
*/ | |
/* | |
* False Position Method | |
* This solution is for the following equation | |
* f(x)=(x-4)^2(x+2)=0 | |
* given initial guesses xL=-2.5, xU=-1.0 |
This file contains 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
/* | |
@ Author: Nasir Islam Sujan | |
@ GitHub: https://github.com/78526Nasir | |
*/ | |
/* | |
* This solution was written for | |
* the following equation | |
* f(x) = x^3 - 0.165x^2 + 3.993 * 10^-4 | |
You need an absolute relative approximate error of 5% or less. |
This file contains 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
/* | |
@ Author: Nasir Islam Sujan | |
@ GitHub: https://github.com/78526Nasir | |
*/ | |
/* | |
* This solution was written for | |
* the following equation | |
* f(x) = x^3 - 0.165x^2 + 3.993 * 10^-4 |
This file contains 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
/* | |
@ Author: Nasir Islam Sujan | |
@ GitHub: https://github.com/78526Nasir | |
*/ | |
/* | |
* This solution is written for the follwing equation | |
* dy/dx=x+2y, where y(x0)=y(0)=0 | |
* we need to use Euler's method to find a value for the |
This file contains 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
// Round Robin CPU scheduling algorithm implementation in C! | |
#include<stdio.h> | |
#define max 20 // maximum size for array | |
main() | |
{ | |
int i,burstTime[max],remainTime[max],remainProcess,arrivalTime[max],totalExecutionTime=0,timeQuantum,flag=0,n; | |
float totalWaitingTime=0; | |
printf("Enter the Number of Process(max 20) : "); | |
scanf("%d",&n); // n is the number of Process |
This file contains 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
// First Come First Served computer scheduling Algorithm implementation in C! | |
#include <stdio.h> | |
#define max 20 /// fixed maximum size for array | |
main() | |
{ | |
int process,burstTime[max],waitingTime[max],averageWaitingTime=0,i,j; | |
printf("Enter The Number of Process(Max 20) : "); | |
scanf("%d",&process); |
This file contains 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
/* This Program is for creating child process. It works only in Linux operating System. | |
//To run this code in linux environment you need to follow the below steps: | |
1. write cc and then put the '.c' "file location/address here" then press enter. | |
2. write ./a.out to generate the output of the code. | |
*/ | |
#include <stdio.h> |
This file contains 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
/// Delete an elements from an array /// | |
#include <stdio.h> | |
main() | |
{ | |
int a[5]={1,2,3,4,5},n=5,pos,item,i,j; | |
printf("Enter an position to delete an element:"); | |
scanf("%d",&pos); | |
printf("Before deleting element :\n"); | |
for(i=0;i<n;i++) |
This file contains 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
/// insert new elements into an array /// | |
#include <stdio.h> | |
main() | |
{ | |
int a[100],n,pos,item,i; | |
printf("Enter how many elements :"); | |
scanf("%d",&n); | |
printf("Enter %d elements values :",n); | |
for(i=0;i<n;i++) |
This file contains 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
/* ceiling and floor a number without using library function's */ | |
#include<stdio.h> | |
int CEIL(double v) | |
{ | |
if(v-(int)v==0) // check weather the float variable contains a integer value or not // | |
return v; | |
else |
NewerOlder