• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Arrays
 

Arrays

on

  • 595 views

 

Statistics

Views

Total Views
595
Views on SlideShare
595
Embed Views
0

Actions

Likes
0
Downloads
0
Comments
0

0 Embeds 0

No embeds

Accessibility

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Arrays Arrays Presentation Transcript

    • Arrays LAB
    •  
      • #include<conio.h> #include<stdio.h> void main(void) {     int num1, num2, num3, num4, num5;     float result;     scanf(&quot;%d,%d,%d,%d,%d&quot;,&num1, &num2, &num3, &num4, &num5);     result = (num1+num2+num3+num4+num5)/5;     printf(&quot;%f&quot;,result); }
    • Array Definition
      • #include<conio.h> #include<stdio.h> void main(void) {     int temp[7];     double temp1[7];     float temp2[7];     char temp3[7]; }
    •  
      • #include<conio.h> #include<stdio.h> void main(void) {     clrscr();     int num[5];     float result = 0;     for(int i=1; i<=5; i++)     {         scanf(&quot;%d&quot;,&num[i]);     }     for(int j=1; j<=5; j++)     {         result = result+num[j];     }     printf(&quot;%f&quot;,result);     getch(); }
    •  
      • #include<conio.h> #include<stdio.h> #define LIM 4 void main(void) {     clrscr();     int num[LIM];     for(int i =0; i<LIM; i++)     {         scanf(&quot;%d&quot;,&num[i]);     }     for(int j=0; j<LIM; j++)     {         printf(&quot;%d&quot;,num[j]);     }     getch(); }
    •  
      • #include<conio.h> #include<stdio.h> #define LIM 4 void main(void) {     clrscr();     int num[LIM] = {1,2,3,4};     printf(&quot;%d&quot;,num[2]);     getch(); }
    •  
      • #include<conio.h> #include<stdio.h> #define LIM 4 #define PRINT(N) printf(&quot;%d&quot;,N); #define ADD(X,Y) (X+Y) void main(void) {     clrscr();     int num[LIM] = {1,2,3,4};     int result;     PRINT(ADD(num[2],num[3]));     getch(); }
    •  
      • #include<conio.h> #include<stdio.h> void main(void) {     clrscr();     char ch[24];     for(int i=0; i<=7; i++)     {         ch[i] = getch();     }     getch(); }
    • Exercises
        • get the string and print reverse of it.
        • get string than find the numbers in string and sum all number
        • get the temperature for each day and find out the average , lowest and maximum average. 
        • using preprocesser directives create calculator and print error on default using preprocessor directives.
        • find out and calculate vowels used in a string   
      •  
      •  
      • use character type array for string
      • get array using for loop , while loop and do while