Intro Programming
Intro Programming
Intro
Programming
What is the programming?
Imagine programming as giving instructions to a robot,
but instead of using words, you use a special language
that the robot understands. This language is made up
of specific commands and words that tell the robot
exactly what to do, step-by-step.
No
w, let's break down the key components of
programming:
What is C?
Why learn C?
#include <stdio.h>
int main() {
printf("Hello, world!\n");
}
#include <stdio.h>
2. int main() {
3. printf("Hello, world!\n");
4. return 0;
Meaning: This line tells the computer that the
program has finished successfully. It's like giving a
thumbs up to say "all good!"
5. }
scanf() function
The scanf() function is used for input. It reads the input data from the
console.
#include <stdio.h>
int main() {
int num;
Compilation process in c
What is a compilation?
The compilation is a process of converting
the source code into object code. It is done
with the help of the compiler. The compiler
checks the source code for the syntactical
or structural errors, and if the source code
is error-free, then it generates the object
code.
What is the Variables
Key points:
1. int (Integers):
Key points:
int: %d
float: %f
char: %c
string: %s
Additional Notes:
Remember:
int main() {
int age;
float height;
char initial;
char name[50];
printf("\nYou entered:\n");
printf("Age: %d\n", age);
printf("Height: %.2f meters\n", height);
printf("Initial: %c\n", initial);
printf("Name: %s\n", name);
return 0;
}
Some Practices Session
Write a c program Age Calculator:
Write a C program Add two Number And Display
result on Sum Variable
Write a c program Calculate of Area of Rectangle
Write A c program Calculate Area of Rectangular
Interview Questions