Please Comment, Subscribe and Click Bell🔔🔔🔔 Icon for More Updates. To learn software course from our experts please register here for online training: goo.gl/HIB0wL
Sir,Actually if we choose array size as 50 and wanted to enter 50 elements than how can we insert a new element into this array in any location inside it...
@@kvenkatram6752 Hi,Good Question. in this case you need to increase the size first from 50 to 60 or 70(upto how many element you want to insert). lets say if you want to insert 3 element,make it 55. Hope you understand it.
Here is the first complete code: Of Insert element in array. #include main() { int arr[50]; int n, ins,i,loc; printf("enter the size n of array in use "); scanf("%d",&n); printf("start entering %d elements now ",n); for(i=0;i=loc;i--) { arr[i+1]=arr[i]; } arr[loc]=ins; printf("new updated array is "); for(i=0;i
You are done a good job👏👍. This is very helpful for non software graduates (hardware) because I am an Electrical student. Your training sessions are very helpful for our students and you are explaining very clearly and well👏👏👍👌. Keep it up srinivas sir
here is code example: #include #include int main() { int arrA[50],i,m,n,arrB[20],loc; printf("enter your arrA size: "); scanf("%d",&m); printf("enter your arrA "); for(i=0;i
@@ajjunikhila you don't need to use stdlib.h in this program, there is no error even u don't include it. In code-block IDE, it is a default that they are including both header files when you create a new project, that is why. By the way, stdlib.h is related to function and method for memory allocation and on the other hand stdio.h contains methods related to file input and output.
Awesome explanation of a horrifying program. In few hours of lecture, i learnt a lot ,build up concept, way to approach to solve to problem. Thank you sir
Sir in previous video ur saying wrong strlen() function counts including null character it counts from 0 to 9 not 1 to 9 .bcz of this when I am watching the 3 part of string to reverse the string I am not getting output I have check code and entered everything like u said but the one thing u said wrong about this strlen() by using this it swaps the null charater also so we have to use strlen()-1 then null will not Swaped.
#include void main() { int arr[10],n,i,key,loc; printf("enter the elements that should be stored "); scanf("%d",&n); printf("enter the %d elements :",n); for(i=0;i=loc;i--) { arr[i+1]=arr[i]; } arr[loc]=key; } not getting correct output
Sir, actually there might be some problem in the program of insertion of a new element in the array, Because when I execute it in my PC I found that when I insert a new element and then try to print the whole series of the array to check whether everything is perfect I saw an element got deleted and shifting has occurred but the first element of the array has been deleted which shouldn't happen according to your explanation.can you just say what's wrong ??
#include #define start main int start () { int a[6] = {10,20,30,40,50,60}; int b[3] = {100,200,300}; int loc,i,m=6,n=3; printf("Enter location to insert: "); scanf("%d",&loc); for (i=m-1; i>=loc; i--) { a[i+n] = a[i]; } for(i=0; i
i got it //WAP to insert a element in array #include int main(void) { int arr[50],n,i,key,loc,j; printf("Enter the size of array:"); scanf("%d",&n); printf("Enter the elements of array:"); for(i=1;i=loc;i--) { arr[i+1]=arr[i]; } arr[loc]=key; for(j=1;j
Program for inserting one array element into another array #include #include int main() { int a[50],b[60],m,n,i,key,loc; printf("enter the size of array elements: "); scanf("%d",&n); printf("enter the %d elements ",n); for(i=0;i
Sir i am truly amazed by the way of explaining these things you show these programs as a piece of cake...........thanq so much sir but i have a question sir i want sorting and searching algos in 2D array sir can u try to provide it to me or others i have seen others are also asking for the same.......it will be a great show of caring for your students......thanx again sir keep it up
Sir when we enter the fixed size of the array, how does it become to 6 which means how size increase? And can we perform with the help of an increment operator ?
hey guys, here is the code for the last question about taking the elements b [ ] and inserting them in a [ ]. #include int main() { int a[9]={10, 20, 30, 40, 50, 60}; int b[3]={100, 200, 300}; int i; int loc=2; for (i=5; i>=loc; i--) { a[i+3]=a[i]; } for(i=0; i
Hi Sir, we have defined the key location and loc location in the memory location and definition coding, however, we have given an integer value to the key location = 100; and a memory location value to loc=2;. But where have we defined the loc value to be taken as a memory location (2 )in the block???
#this code is written in python for inserting element a = [1,2,3,4,21,34,12,5,7] element=int(input("enter a element you want to insert:")) ind=int(input("enter a index for that element:")) a.insert(ind,element) print(a)
U r d bst teacher to explain i understand very clearly right ..will you teach devops also sir if u teach means ivl come nd join in institution sir plz rply me...