Touch here to read

Programming in C by Sarmi Sasirekha

Sarmi Sasirekha
Sarmi Sasirekha

/ 163

Note for Programming in C - C By SARMI SASIREKHA

Notes for Programming in C - C

by Sarmi Sasirekha

  • Downloads: 98
  • Views: 647
  • Uploaded 3 months ago
Add to Favourite

Suggested Materials

Leave your Comments


Text from page-1

Back​ ​to​ ​notes​ ​section​ ​: NOTES​ ​FOR​ ​C​ ​LANGUAGE​ ​PART​ ​1 What​ ​is​ ​Complier? Compiler is a program that converts the source code (program written in a language other than machine language ) in to machine code. Computer can understand machine code and execute machine code​. Therefore we can state that compiling is a process of converting source code to machine code if​ ​source​ ​code​ ​is​ ​error​ ​free. What​ ​is​ ​the​ ​basic​ ​structure​ ​of​ ​c​ ​program? Consider​ ​a​ ​simple​ ​program #include​ ​<stdio.h> #include​ ​<conio.h> void​ ​main() { int​ ​a,b; printf(“\n​ ​enter​ ​two​ ​values”); scanf(“%d​ ​%d”,&a,&b); c=a+b; printf(“\n​ ​addition=%d”,c); getch(); } We​ ​can​ ​note​ ​following​ ​facts: 1.​ ​Program​ ​starts​ ​with​ ​#include #include is known as preprocessor directive. This preprocessor directive gives instruction to preprocessor program to include contents of file mentioned in angle bracket (or in double quotes) to our source file. The file name in angle bracket is known as include file (because this is used always with include preprocessor) or header file (appears in head/top position of file). This header files​ ​contents​ ​macro,​ ​constant​ ​and​ ​function​ ​declaration. 2.​ ​void​ ​main() void​ ​specifies​ ​function​ ​does​ ​not​ ​return​ ​value. ‘main’ is a function which acts as entry point from which our program statement starts​ ​running.​ ​Declaration​ ​statement​ ​is​ ​followed​ ​by​ ​executable​ ​statements.