Breaking

शनिवार, 4 अप्रैल 2020

BCA 2nd Sem Notes - Implementation without using standard library function

  • UNIT-I (Array)
Definition
Declaration & initialization of 1D 
Accessing array elements
Displaying array elements
Sorting arrays
Arrays and function
Declaration & initialization of 1D
Accessing and Displaying
Memory representation of array [Row Major, Column Major]
Multidimensional array



  • UNIT-II (Pointers)
  • Definition

    Declaration & initialization
    Indirection operator
    address of operator
    pointer arithmetic
    dynamic memory allocation
    arrays and pointers
    function and pointers




  • UNIT-III (Strings)

  •   strlen(),strcpy(),       strcat() ,strcmp()



  • UNIT-IV (Structures)
  • Definition



  • UNIT-V                                     (C Pre-processor)




  • UNIT-VI                                (File Handling)


  • Definition of Files,
    Opening modes of files
    Standard function
    fopen(), fclose(),             feof()  fseek(),                    fewind()
    Using text files
    fgetc(), fputc(), fscanf()

     Implementation without using standard library function 


     find the length of the string using given library function, but in this program, we are finding the length of the string without using library function

    #include<stdio.h>
     int main() 
    {   
    char str[100]; 
      int length;  
      printf("\nEnter the String : ");  
    gets(str);    length = 0;  // Initial Length    
    while (str[length] != '\0')      
    length++;    printf("\nLength of the String is : %d", length);
       return(0);
    }
    Explanation of Program :

    printf("\nEnter the String : ");gets(str);

    After that we have initialized the length variable with zero. “length” variable is used to keep track of the number of character accessed

    length = 0;  // Initial Length
    The initial length is 0. Now we are accessing very first character. If it is equal to NULL then we are terminating the loop else we are incrementing the length.


    while (str[length] != '\0')      
    length++;


     Previous Page                                          Print Page
    Next Page  

    कोई टिप्पणी नहीं:

    एक टिप्पणी भेजें