0
0
Cprogramming~5 mins

What is C

Choose your learning style9 modes available
Introduction

C is a simple and powerful programming language used to tell computers what to do.

When you want to create programs that run very fast.
When you need to control hardware or work close to the computer's brain.
When you want to learn the basics of how programming works.
When you want to build software like games, tools, or operating systems.
When you want to write code that can work on many different computers.
Syntax
C
/* C program structure */
#include <stdio.h>

int main() {
    // Your code here
    return 0;
}

The #include <stdio.h> line lets you use input and output functions.

The main function is where the program starts running.

Examples
This program prints "Hello, world!" on the screen.
C
#include <stdio.h>

int main() {
    printf("Hello, world!\n");
    return 0;
}
This program stores a number and prints it.
C
#include <stdio.h>

int main() {
    int number = 5;
    printf("Number is %d\n", number);
    return 0;
}
Sample Program

This simple program shows a welcome message on the screen.

C
#include <stdio.h>

int main() {
    printf("Welcome to C programming!\n");
    return 0;
}
OutputSuccess
Important Notes

C programs need to be compiled before running. This means changing the code into a language the computer understands.

Every C program must have a main function where it starts.

Use printf to show messages on the screen.

Summary

C is a basic and fast programming language.

It is used for many types of software and learning programming.

Programs start running from the main function.