Download presentation
Presentation is loading. Please wait.
Published byDiane Bryant Modified over 9 years ago
1
Data structure and c K.S. Prabhu Letterer All Deaf Educational Technology
2
Introduction in c C program made by ken Thompson and Dennis Ritchie in 1970. Developed by martin Richards. Although C was designed for implementing System Software. It is also widely used for developing portable Application Software.
3
ken Thompson and Dennis Ritchie
4
Means C program mean compiler programming C is a Program language. It is a middle level language This programming language is designed to help as Data process. Data process is numbers, characters and strings. Its provide use of output display
5
C Program logo and Code
6
The Character Set in C 1)Upper case alphabets: It is capital word alphabets Example: A B C D E …….Z
7
Sample code Program #include power(int*m,int*n); void main() { int X,Y; clrscr(); printf("Enter number:"); scanf("%d",&X); fflush(stdin); printf("Enter power to raise to:"); scanf("%d",&Y); fflush(stdin); power(&X,&Y); …………….. ……………… ………………. getch();
8
2) Lower case alphabets: It is small word through called by lower case alphabets Example: a b c d e……..z
9
Sample Code Program #include power(int*m,int*n); void main() { int x,y; clrscr(); printf("Enter number:"); scanf("%d",&x); fflush(stdin); printf("Enter power to raise to:"); scanf("%d",&y); fflush(stdin); power(&x,&y); …………….. ……………… ………………. getch(); }
10
3) Numbered or digital characters: It means also used by number or Ditital characters. Example: 0 1 2 3 4 5 6 7 8 9
11
Sample code Program #include void main() { int a,b; char cmd[25]; ………. } #include void main() { char name[21],addrs[31]; clrscr(); puts("Enter your Name to a maximum of 20 characters"); puts("Enter your Address to a maximum of 30 characters"); …… }
12
4) Arithmetic Operators: It means arithmetic program through operated by arithmetic operators. Example: +, %, *, - Plus,Division,Multiple and Minus
13
Sample Code Program #include sum(int a,int b); void main() { int x,y,value; scanf("%d%d",&x,&y); value=sum(x,y); printf("Total is %d\n",value); } sum(int a,int b) { return a+b; } OUTPUT Output:: 5 3 Total is 8
14
5) Relational Operators: It is numberic and case character relation operated by relational operators. Syntax:-,, =, = Less and Great, Less Equal Great,Equal Example Example: 4>5,6<4,4=4
15
Sample Code Program #include void main() { int I,sum,num; clrscr(); sum=num=0; for(I=0;I<8;I=I+1) { …….. if(num<=0) getch(); }
16
6) curly brace: Syntax:- { } { → Starting curely space } → Ending curely space Example: {……………………}
17
Sample Code Program { Head of curly ………….. { Sub of curly ………….. } Sub End of curly ………. getch(); } Head End of Curly
18
7) Square braces: Syntax:- [ ] Example: Float [4] ; String [9] ;
19
Sample Code program #include void main() { char str1[101],str2[101]; int diff,I=0; clrscr(); ……….. getch(); }
20
8) Parenthèses braces :- Syntax:- ( ) Example: Print (………) Scant (………)
21
Sample Code program Program:: #include void main() { char in_str[21]; clrscr(); puts("Enter a string to a maximum of 20 characters"); gets(in_str); fflush(stdin); puts(in_str); getch(); }
22
9)Special characters: It mean other syntax characters Syntax:- &, !, #, ?, ~, `, @, ^, $, |,:,;.
23
Sample code program #include void main() { char yn; clrscr(); do { puts("enter y/n(yes/no)"); yn=getchar(); fflush(stdin); if(yn!='y'&&yn!='n') puts("invalid input"); } while(yn!='y'&&yn!='n'); getch(); }
24
Special Character:
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.