0% found this document useful (0 votes)
69 views

Programming Language

Uploaded by

api-245103214
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
69 views

Programming Language

Uploaded by

api-245103214
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 12

C

Programming Language

Introduction
C low level language Its just combined and moved about with the arithmetic and logical operators implemented by real machines. There are no operations that manipulate language does not define any storage allocation. No input/output, No Read/write

A Hello C program
In C, the program to print something , we have use printf
#include<stdio.h> main() { printf(hello world\n); }

To execute cc hello.c a.out

printf(hello world\n); \n in string is C notation for the newline character Without \n Compiler will show an error

Data types
int integer valude b/w -32768 to +32767 float six significant digits Char - character Short short integer Long long integer Double double precision floating point

Loops
While : check the condition and process Do- while : before checking the condition do the function then check For :

While
Int X=5 Int Y=10 While(x<y) { Printf(x); x=x+1; }

/ condition checks

If Condition true, it continuous until condition became false Output 56789

Do while
Int x=10 Int y=20 Do{ Printf(x); Whie(x>y) } Here , Condition false but the function will process once

For loop
#include<stdio.h> Main() { int x; for (x=0;x<=3;x=x+1) Printf(x); } Output 0123

Symbolic Constants
#define name replacement text
#include<stdio.h> #define x 10 Main() { Printf(x); }

Output 0

/*

*/

For comment , Between /* and */ are ignored by the compiler They may be used freely to make a program easier to understand

Character Input and output


getchar putchar getchar(c) reads the next input char putchar(c) prints the contents

You might also like