Inserting an element in an array (C program)

Поділитися
Вставка
  • Опубліковано 10 кві 2020
  • Follow my Whatsapp channel for content updates, questions, contests and many more...
    whatsapp.com/channel/0029VaEh...
    Technical lectures by Shravan Kumar Manthri.
    Watch " Patterns in C- Tips & Tricks " in the following link...
    www.udemy.com/course/patterns...
    You can watch "Tricky 150 mcqs in C" in the following link
    www.udemy.com/course/best-150...
    Technical lectures by Shravan Kumar Manthri.
    Watch Technical C programming
    • Technical C coding : p...
    Watch Data Warehousing & Data Mining
    • 1. Multi-Dimensional ...
    Watch Design & Analysis of Algorithms
    • 1. Introduction to the...
    Watch Formal Languages & Automata theory
    • 1. Introduction to Aut...
    Visit us: www.csegurus.com
    Contact me @ fb : shravan.kites@gmail.com
    Like us on fb: CSE GURUS
    This video Inserting an element in an array with execution. #ShravankumarManthri#CSEGURUS #ShravankumarManthri#CSEGURUS

КОМЕНТАРІ • 58

  • @vivektripathi2016
    @vivektripathi2016 10 місяців тому

    This video is very helpful 😊😊

  • @Mamathahomemadepowder
    @Mamathahomemadepowder Рік тому +1

    Sir y we should decrement here we need to increment right

  • @prashanthkumards9918
    @prashanthkumards9918 2 роки тому

    Thanks a lot

  • @dipeshchoudhary1267
    @dipeshchoudhary1267 2 роки тому +5

    Very nice explanation..... Thank you so much..... You solved my problem.... Thank you again ❤

    • @CSEGURUS
      @CSEGURUS  2 роки тому +1

      Very glad to hear from u... Keep Learning..
      You can watch this playlist for more stuff in C
      ua-cam.com/play/PLYT7YDstBQmEGhVqAoubBS0OE_5m4JDUe.html

  • @priyankapaul7077
    @priyankapaul7077 2 роки тому +3

    Sir if i want to do while loop then how can i do , i try lot but i dont understand how to do ?

    • @flynneugene2675
      @flynneugene2675 Рік тому

      instead of for use while thats all
      use while until i reaches the particular positoin

  • @aariffmohd4980
    @aariffmohd4980 2 роки тому +1

    Thnks so mch sir❤️

    • @CSEGURUS
      @CSEGURUS  2 роки тому

      Most welcome..
      You can watch this playlist for more stuff in C
      ua-cam.com/play/PLYT7YDstBQmEGhVqAoubBS0OE_5m4JDUe.html

  • @user-ul6uj2sw9j
    @user-ul6uj2sw9j 5 місяців тому +1

    simple explanation👌❤ thank you

    • @CSEGURUS
      @CSEGURUS  5 місяців тому

      You're welcome 😊...Watch Top 90 Data Structures MCQs in the following link...
      ua-cam.com/video/i2LTAJhkFf8/v-deo.html

  • @nikhilkumar8362
    @nikhilkumar8362 2 роки тому

    great explanation sir ☺️☺️

    • @CSEGURUS
      @CSEGURUS  2 роки тому

      THank you...You can watch this playlist for more stuff in C
      ua-cam.com/play/PLYT7YDstBQmEGhVqAoubBS0OE_5m4JDUe.html

  • @filmyduniya478
    @filmyduniya478 2 роки тому

    Very nice explanation sir ....

    • @CSEGURUS
      @CSEGURUS  2 роки тому

      Thanks and welcome....You can watch this playlist for placement related stuff in C
      ua-cam.com/play/PLYT7YDstBQmEGhVqAoubBS0OE_5m4JDUe.html

  • @gayathrisabbella3012
    @gayathrisabbella3012 Рік тому

    Thank you so much
    Great explanation sir,God bless you

    • @CSEGURUS
      @CSEGURUS  Рік тому

      You are most welcome...
      Watch Top 90 Data Structures MCQs in the following link...
      ua-cam.com/video/i2LTAJhkFf8/v-deo.html

  • @divyanshpandey9047
    @divyanshpandey9047 Рік тому

    = in last for loop is giving garbage value i think it shouldn't be there?

  • @ShivamMishra-ke6gi
    @ShivamMishra-ke6gi 4 роки тому

    Nicemethod of teaching sir

    • @CSEGURUS
      @CSEGURUS  4 роки тому

      Thank you.. Keep Learning...

  • @champianbro2291
    @champianbro2291 Рік тому +1

    suggest any compiler for cprogramming language.

  • @aryarowan2283
    @aryarowan2283 Рік тому

    thank you so much.

    • @CSEGURUS
      @CSEGURUS  Рік тому

      You're welcome...You can watch this playlist for placement related stuff in C
      ua-cam.com/play/PLYT7YDstBQmEGhVqAoubBS0OE_5m4JDUe.html

  • @abethnego8073
    @abethnego8073 3 роки тому

    Nice explainàtion.sir

    • @CSEGURUS
      @CSEGURUS  3 роки тому

      Thanks and welcome..You can watch this playlist for more stuff in C
      ua-cam.com/play/PLYT7YDstBQmEGhVqAoubBS0OE_5m4JDUe.html

  • @arunsharma4792
    @arunsharma4792 3 роки тому +2

    but last value is not printing becz length is not increased......how can we do that ??

    • @florian124
      @florian124 3 роки тому

      Recall that you should loop till your index is less or equal to n in the final printing loop to display the last element.

  • @Instagram_trending_reel1
    @Instagram_trending_reel1 10 місяців тому

    Thank you ☺️💟

    • @CSEGURUS
      @CSEGURUS  9 місяців тому

      Most welcome…You can watch this playlist for placement related stuff in C
      ua-cam.com/play/PLYT7YDstBQmEGhVqAoubBS0OE_5m4JDUe.html

  • @GODTHUNDERAMULYA
    @GODTHUNDERAMULYA 4 місяці тому

    Very helpful

    • @CSEGURUS
      @CSEGURUS  4 місяці тому

      Most Welcome..
      Watch all sortings with clear explanation in the following link..
      www.udemy.com/course/draft/3956622/?referralCode=306AAC6206D9B4584A1B

  • @rayan8847
    @rayan8847 3 роки тому

    Wonderfully explained

    • @CSEGURUS
      @CSEGURUS  3 роки тому

      Glad you liked it...You can watch this playlist for more stuff in C
      ua-cam.com/play/PLYT7YDstBQmEGhVqAoubBS0OE_5m4JDUe.html

  • @faizufaiz5198
    @faizufaiz5198 4 місяці тому

    Thank u

    • @CSEGURUS
      @CSEGURUS  4 місяці тому

      Most Welcome..
      Hit the below link for best techniques in patterns in C. ua-cam.com/video/hWhMAoBhi7M/v-deo.html

  • @nusrat14082
    @nusrat14082 9 місяців тому +1

    A little correction:
    array[position] = value ;

  • @bhavikbansiwal5304
    @bhavikbansiwal5304 8 місяців тому

    You should do code for it pn your computer screen

    • @CSEGURUS
      @CSEGURUS  7 місяців тому

      You can watch this playlist for placement related stuff in C
      ua-cam.com/play/PLYT7YDstBQmEGhVqAoubBS0OE_5m4JDUe.html

  • @user-il8hj7qh2h
    @user-il8hj7qh2h Рік тому

    Why we cant insert like this temp=array[position]
    array[position]=element
    array[size]=temp..
    Pls rply sir...

  • @a-classzone1998
    @a-classzone1998 2 роки тому +2

    The second last for loop is wrong!!!There you have to take i>=position-1.

  • @rajeshkumar-gf1we
    @rajeshkumar-gf1we 3 роки тому +1

    why we need to take (pos-1) if we want to put the value in the index 3 we can directly give for(int i=0;i>=pos;i--)

    • @florian124
      @florian124 3 роки тому

      GDB can better answer your question, so debug your code by watching carefully the values taken by pos and i.

    • @nithinkshetriya6095
      @nithinkshetriya6095 Рік тому

      beacuse index = pos -1

    • @user-il8hj7qh2h
      @user-il8hj7qh2h Рік тому

      Why we cant insert like this temp=array[position]
      array[position]=element
      array[size]=temp..
      Pls rply

  • @madhusharma5342
    @madhusharma5342 2 роки тому +1

    Sir what is i ???

    • @madhusharma5342
      @madhusharma5342 2 роки тому +2

      Plz explain[ printf("enter%d elements /n" , n); ]
      Why we use n at the end?????..
      What it's role?

    • @madhusharma5342
      @madhusharma5342 2 роки тому +1

      Plz sir reply me soon...

    • @CSEGURUS
      @CSEGURUS  2 роки тому

      The format specifier %d will be replaced by the value of n.

  • @gaganthakur7619
    @gaganthakur7619 3 роки тому

    Hindi ch bolia kro sir

  • @777sarthik
    @777sarthik 2 роки тому

    500 likes

  • @sarthakmoriya541
    @sarthakmoriya541 3 роки тому +14

    Code is wrong

  • @SarafatAlamIrfan
    @SarafatAlamIrfan Рік тому +1

    #include
    int main()
    {
    int array[50], position, c, n, value;
    printf("Enter number of elements in the array
    ");
    scanf("%d", &n);
    printf("Enter %d elements
    ", n);
    for (c = 0; c < n; c++)
    scanf("%d", &array[c]);
    printf("Please enter the location where you want to insert an new element
    ");
    scanf("%d", &position);
    printf("Please enter the value
    ");
    scanf("%d", &value);
    for (c = n - 1; c >= position - 1; c--)
    array[c+1] = array[c];
    array[position-1] = value;
    printf("Resultant array is
    ");
    for (c = 0; c