Skip to main content

How to run a C/C++ program in Linux mint/ubantu/other

Run A C/C++ program in mint / ubantu / other linux



Hello friends, here we are going to run a c program file in linux mint.

Here is some step which return below the video ,
You can simply watch the video or follow the step ....

VIDEO



Steps for Run C program file in terminal

  1. first open software manager/ store and download the "G++" or you can also " apt get" for install g++.
  2. Open any editor and make a c/c++ file and save it on any location.
  3. Now open terminal and go to your file location (lets say it "Desktop" then go to Desktop by  cd Desktop command).
  4. Now Type g++ filename.c -o outputfilename then press enter. (filename = your file name  and  outputfilename = what output name you want)

Comments

Popular posts from this blog

Shortest Remaining Time First (SRTF) Program in C++ || dot clu

Shortest Remaining Time First (SRTF) Program in C++ || dot clu Shortest Remaining Time First (SRTF) Shortest Remaining Time First (SRTF) Algorithm is preemptive version of Shortest Job First Algorithm. In this current process is executed until it is completed or a new process is added having lower burst time compare to the the remaining time for current process. SRTF algorithm may lead to starvation, if processes with lower burst time continues to add to cpu scheduler then the current process will never get a chance to get executed. For example consider the following table Process Arrival Time Burst Time P1 0 10 P2 1 6 P3 2 9 P4 3 4 At time t=0, Process P1 will start get executing as it is only the process present at that time. Then at t=1, Process P2 added to the CPU scheduler, at this time remaining time(Burst time) for Process P1 gets 9, as Burst time of P2 is less than the remaining time of other processes (for now there is only process P1) therefore process

Round Robin Scheduling Program in C++ || dot clu

Round Robin Scheduling Program in C++ Process scheduling is an important component for process management. In a multi-user and a time-sharing system, response time is one of the most important objective to be accomplished. Round Robin Scheduling Algorithm 1. The queue structure in ready queue is of First In First Out (FIFO) type. 2. A fixed time is allotted to every process that arrives in the queue. This fixed time is known as time slice or time quantum. 3. The first process that arrives is selected and sent to the processor for execution. If it is not able to  complete its execution within the time quantum provided, then an interrupt is generated using an automated timer. 4. The process is then stopped and is sent back at the end of the queue. However, the state is saved and context is thereby stored in memory. This helps the process to resume from the point where it was interrupted. 5. The scheduler selects another process from the ready queue and dispatches it

C++ Program For PRIORITY WITH NON - PREEMPTIVE Scheduling Algorithm || dot clu

C++ Program For PRIORITY WITH  NON - PREEMPTIVE Scheduling Algorithm It is important to distinguish  preemptive  from  non - preemptive scheduling algorithms.  Preemption  means the operating system moves a process from running to ready without the process requesting it. Without  preemption , the system implements ``run to completion (or yield or block)''. Non-Preemptive Scheduling Non-Preemptive Scheduling means once a process starts its execution or the CPU is processing a specific process it cannot be halted or in other words we cannot preempt (take control) the CPU to some other process. A computer system implementing this cannot support the execution of process in a multi task fashion. It executes all the processes in a sequential manner. It is not practical as all processes are not of same priority and are not always known to the system in advance. Source Code: #include <iostream> using namespace std; int main() {     int n;     cout