Data structure and c
This presentation is the property of its rightful owner.
Sponsored Links
1 / 25

Data structure and c PowerPoint PPT Presentation


  • 54 Views
  • Uploaded on
  • Presentation posted in: General

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.

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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Data structure and c

Data structure and c

K.S. Prabhu

Letterer

All Deaf Educational Technology


Introduction in c

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.


Ken thompson and dennis ritchie

ken Thompson and Dennis Ritchie


Means

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


C program logo and code

C Program logo and Code


The character set in c

The Character Set in C

  • Upper case alphabets:

  • It is capital word alphabets

    Example:

  • A B C D E …….Z


Sample code program

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);


Data structure and c

2) Lower case alphabets:

  • It is small word through called by lower case alphabets

    Example:

  • a b c d e……..z


Sample code program1

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();

  • }


Data structure and c

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


Sample code program2

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");

……

……

}


Data structure and c

4) Arithmetic Operators:

  • It means arithmetic program through operated by arithmetic operators.

  • Example:

  • + , %, *, -

  • Plus,Division,Multiple and Minus


Sample code program3

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


Data structure and c

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


Sample code program4

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();

}


Data structure and c

  • 6) curly brace:

    Syntax:-

    { }

  • { → Starting curely space

  • } → Ending curely space

  • Example:

  • {……………………}


Sample code program5

Sample Code Program

{  Head of curly

…………..

…………..

…………..

{  Sub of curly

…………..

…………..

}  Sub End of curly

……….

……….

getch();

}  Head End of Curly


Data structure and c

7) Square braces:

Syntax:-

[ ]

Example:

  • Float [4] ;

  • String [9] ;


Sample code program6

Sample Code program

#include<stdio.h>

#include<conio.h>

void main()

{

char str1[101],str2[101];

intdiff,I=0;

clrscr();

………..

………..

getch();

}


Data structure and c

  • 8) Parenthèses braces :-

  • Syntax:-

  • ( )

    Example:

  • Print (………)

  • Scant (………)


Sample code program7

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();

}


Data structure and c

  • 9)Special characters:

  • It mean other syntax characters

    Syntax:-

  • &, !, #, ?, ~, `, @, ^, $, |,:,; .


Sample code program8

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();

}


Special character

Special Character:


  • Login