Last active
September 21, 2019 04:32
-
-
Save henideepak/011105132a437176b3a50b5440605549 to your computer and use it in GitHub Desktop.
How to work c program in terminal command in ubuntu
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
#include<stdio.h> | |
int main() | |
{ | |
int a, b, c; | |
printf("Hello User This is my First Program In C Language\n"); | |
printf("Enter two numbers to add\n"); | |
scanf("%d%d", &a, &b); | |
c = a + b; | |
printf("Sum of the numbers = %d\n", c); | |
return 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
How to work c program in terminal command in ubuntu | |
once you checked GCC version | |
command = gcc --version | |
install c compiler | |
command = sudo apt install build-essential | |
create a file | |
command = touch hello.c | |
open in a sublime text editor | |
command = subl hello.c | |
create an output file | |
command = gcc hello.c -o hello | |
run file | |
command = ./hello |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment