Basic

Switch Case

Goto

Operators

if Statement

Nested if

While Loop

For Loop

Array

Patterns

Excersises


What is C Programming?


C programming is a general-purpose programming language developed by Dennis Ritchie in 1972 at Bell Laboratories.C is used for system applications,develop software like operating systems,compilers,databases and which form a major part of Windows, Linux and UNIX operating Systems.It is a robust language and highly portable.

Hello World Program in C

This example shows, how to print 'Hello World' in C Programming.

#include<stdio.h>
int main(){
  printf("Hello World!");
  return 0;
}

  • #include tells the C preprocessor to include the contents of the file.
  • stdio.h standard input and output header file.
  • main() is a function, execution of C program begins.
  • printf() is a function, used to print the formatted string in output Screen.
  • scanf() is a function, accept input from the user.

Add Two Numbers Program in C

In this example,you will learn how to add two numbers using c Program.

#include<stdio.h>
int main(){
  int a,b,c;
  printf("\nEnter Two Numbers : ");
  scanf("%d%d",&a,&b);
  c=a+b;
  printf("\nTotal : %d",c);
  return 0;
}

Output:

Enter Two Numbers :
 100
 50
Total : 150