This document discusses an introduction to C++ programming. It covers basics like C++ program structure, common commands like input/output, comments, and running a simple "Hello World" program. It also provides tasks for students like writing a program to display an auto biography form with their name, address, birth details, and hobby.
2. yantox_ska@yahoo.com
C is developed by Dennis Ritchie
C is a structured programming language
C supports functions that enables easy
maintainability of code, by breaking large file
into smaller modules
Comments in C provides easy readability
C is a powerful language
Introduction to C Language
9. yantox_ska@yahoo.com
Input
scanf(“%d”,&a);
Gets an integer value from the user and stores it
under the name “a”
Output
printf(“%d”,a)
Prints the value present in variable a on the
screen
Basic Commands C++
10. yantox_ska@yahoo.com
Single line comment
// (double slash)
Termination of comment is by pressing enter key
Multi line comment
/*….
…….*/
This can span over to multiple lines
Comments in C++
11. yantox_ska@yahoo.com
1./* Hello, world program */
2.#include <stdio.h>
3.
4.int main()
5.{
6. printf("hello, ");
7. printf("worldn");
8. return 0;
9.}
Simple Program
12. yantox_ska@yahoo.com
Type a program
Save it
Compile the program – This will generate an
exe file (executable)
Run the program (Actually the exe created out
of compilation will run and not the .c file)
In different compiler we have different option
for compiling and running. We give only the
concepts.
Running a C Program
13. yantox_ska@yahoo.com
Write a program to display your identity with a
form below :
------------------------------------------------------
AUTO BIOGRAFI
------------------------------------------------------
Name : <nama>
Address : <alamat>
Place of Birth : <tmp_lahir>
Date of Birth : <tgl_lahir>
Hobby : <hobby>
------------------------------------------------------
Task 1