Singly Linked List in C with Code and Explanation

Image
                        Singly LinkedList (SLL)   A Singly Linked List is a linear data structure where each element (called a node ) points to the next node in the sequence.  It is a dynamic structure , meaning it can grow or shrink in size during runtime .  Structure of a Node:  Each node contains: - Data : The value stored in the node. - Next : A pointer / reference to the next node in the list . There are Five operation in SLL: 1) Insert - Insert the element in our node like, insert(34);                                                                            insert(3);                                       ...

Subtraction of Two Number by using C Language

Subtractions   of   Two   Numbers   :

#include <stdio.h>
int main()
{
    int a, b, c;
    printf("enter two number for substraction:");
    scanf("%d %d", &a, &b);
    c = a - b;
    printf("substraction of two number id %d and %d is = %d ", a, b, c);
    return 0;
}

💢 Output  :

enter two number for substraction:101 ,109
subtracti
on of two number id 101 and 109 is = -8 

Algorithm to Subtract Two Numbers

  1. Start.
  1. Start.
  2. Read two numbers as A and B.
  3. Calculate the difference of the two numbers: Difference = A - B.
  4. Display the value of Difference.
  5. Stop

💢 Flowchart for Subtracting Two Numbers 
   +-------------------+
   |    Start          |
   +-------------------+
           |
           v
   +-------------------+
   | Read A and B      |
   +-------------------+
           |
           v
   +-------------------+
   | Difference = A - B |
   +-------------------+
           |
           v
   +-------------------+
   | Display Difference |
   +-------------------+
           |
           v
   +-------------------+
   |      Stop         |
   +-------------------+

Comments

Popular posts from this blog

Selection sort (code & Algorithm)

Multiplication of two number by using C Programs

Addition of two Number using c language code