1 / 25

Data structure and c

Data structure and c. K.S. Prabhu Letterer All Deaf Educational Technology. 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.

carter
Download Presentation

Data structure and c

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  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 • Upper case alphabets: • It is capital word alphabets Example: • A B C D E …….Z

  7. Sample code Program fflush(stdin); printf("Enter power to raise to:"); scanf("%d",&Y); fflush(stdin); power(&X,&Y); …………….. ……………… ………………. getch(); #include<stdio.h> power(int*m,int*n); void main() { int X,Y; clrscr(); printf("Enter number:"); scanf("%d",&X);

  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<stdio.h> power(int*m,int*n); void main() { intx,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<stdio.h> void main() { inta,b; char cmd[25]; ………. ………. ………. } #include<stdio.h> #include<conio.h> 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<stdio.h> sum(inta,int b); void main() { intx,y,value; scanf("%d%d",&x,&y); value=sum(x,y); printf("Total is %d\n",value); } sum(inta,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<stdio.h> #include<conio.h> void main() { intI,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<stdio.h> #include<conio.h> void main() { char str1[101],str2[101]; intdiff,I=0; clrscr(); ……….. ……….. getch(); }

  20. 8) Parenthèses braces :- • Syntax:- • ( ) Example: • Print (………) • Scant (………)

  21. Sample Code program Program:: #include<stdio.h> #include<conio.h> 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<stdio.h> #include<conio.h> 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:

More Related