Skip to main content

C Programming Introduction

 

hi friends! Before we depth into c program let us understand, what is programming

Programming is the process of creating a set of instructions that tell a computer how to perform a task.Programming can be done using a variety of computer programming languages, such as JavaScript, Python, and C++, PHP, react native, etc.

ex:- websites are developed using php
mobile application can be developed using reactnative etc

Depending on application type, we choose different programming languages to develop it.

Let us see an example of c programming to print "hello world" on screen
program

#include <stdio.h>
int main()
{
/* Our first simple C basic program */
printf("Hello World! ");
return 0;
}

output
Hello World!

run the code on online compiler https://www.onlinegdb.com/online_c_compiler or install c compiler on system and run c programs.

C Basic commands Explanation
#include <stdio.h> This is a preprocessor command that includes standard input output header file(stdio.h) from the C library before compiling a C program

int main() This is the main function from where execution of any C program begins.

{ This indicates the beginning of the main function.

/*_some_comments_*/ whatever is given inside the command “/*   */” in any C program, won’t be considered for compilation and execution.

printf(“Hello_World! “); printf command prints the output onto the screen.

return 0;
This command terminates C program (main function) and returns 0.

}
This indicates the end of the main function.



















      

 


Comments

Popular posts from this blog

C pointers

  C pointers theory C pointers practice 1)Adding two numbers using pointer 2)multiplying 3 numbers using pointers 3)Program to Swap Elements Using Call by Reference(using pointer) 4)Access the elements of array using pointer and display the largest number      

C Functions

  User Defined Function User defined Function return practice 1)C Program to Display Prime Numbers Between Intervals Using Function 2)C Program to Check Prime or Armstrong Number Using User-defined Function 3)C Program to Find the Sum of Natural Numbers using Recursion      

C Control Statements

for Loop while loop do...while loop practice 1)print Fibonacci  series 2)check whether given number is palindrome 3)c program to reverse a number