You are great Sir. I follow the lectures of you. That are very easy after watching. Thanks a lot Sir. A big salute to you.
@vijaysinghchauhan70795 жыл бұрын
hey,neso academy team can you plss.. upload videos on the array operations such as : insertion,deletion,search etc.
@tayyab.sheikh9 ай бұрын
I'm amazed to see such an intuitive explanation!!!
@payalsingh42109 ай бұрын
The quality of information and knowledge you providing us is far better then any other famous utube coding channels like apni kaksha and all🌻hat's off to you
@nik-ys8ki4 жыл бұрын
interesting solution what i did was lengthy perhaps, but this is short and more logical way of doing things. instead of checking on digit by digit you solve the problem in nice and smooth manner
@amitbanger6355 жыл бұрын
wow sir just wow
@lalit29264 жыл бұрын
I have made that program but using another logic. But sir your logic is comparatively more short and easier..... 👍👍👍
@javancheongyujing25319 ай бұрын
I got another idea using 2 array of string character. Then compare using nested loop. A1 vs B1, A1 vs B2.. A2 vs B1, A2 vs B2..
@payalsingh42109 ай бұрын
But woo ise bada ho jaye ga..and time me bhi difference aye ga....phele mene bhi wahi socha tha and then I realise his method is more accurate and fast
@kanhaiyasuryawanshi3677 Жыл бұрын
the way you explain the things, it's just excellent.
@vijayalakshmiv17204 жыл бұрын
I am becoming fan of neso academy your lectures were awesome
@achugh52Ай бұрын
this is an innovative way of doing it . generally people apply nested loops for solving
@kayraalpceylan17753 жыл бұрын
what if i enter number "012340", after dividing the first 2 digit which is '01' to 10 it'll give 0 and hence it wouldn't enter while loop and print out "No" so in addition you should also check if it's first is "0" or not.
@Doraemon-cq8jh Жыл бұрын
>= hona chaiye tha
@punith3969 Жыл бұрын
If u do so, 0 preceding actual number is converted to octal equivalent in c and it proceeds
@pk-uk5lc Жыл бұрын
@@Doraemon-cq8jhinfinite loop ho jaayega
@aayushidesai2813Ай бұрын
0 is quotient and we need the remainder which we get 1
@MolletiSaiRevanth4 күн бұрын
Your teaching like god level
@Ishika_eva9 ай бұрын
Its amazing to learn ,such a good explaination,thanks a lot.
@krishsharma1622 жыл бұрын
I want to say, this is the best content
@sreemoyeepradhan7707 Жыл бұрын
Your videos are mesmerizing sir ! Thank you so much for uploading these....🤗
@nskchaitanya2671 Жыл бұрын
great logic ,when i tried on my own it took 3 for loops,but with this one while loop is enough
@imcoder22503 жыл бұрын
you are doing great job sir.......thankyou sir....the way you teach is fabulus......thankyou so much sir
@sourav.singh294 жыл бұрын
Please make a playlist on algorithms....nd try to cover all topics with prerequisites
@MKSundaram4 жыл бұрын
Do you have any video explaining a program to check whether any alpahbets is repeated? By using the same formula, I mean without using for loops. Thanks
@abderrahimbenmhand21293 жыл бұрын
The best Teacher, I learn a lot from you
@AdarshKumar-vt7wc2 жыл бұрын
sir please try to use for or do while loop cuz while loop is kinda useless and only takes our time to learn . practically for loop +if else statement could act as a while loop.
@ashanthilochana4339 Жыл бұрын
You can avoid the part 3 while (num>0){ N = num % 10; if (arr[N] == 1){ printf("Yes!"); } arr[N] = 1; num = num / 10; } like this. Thank you for your video series. I learned lot of things ❤❤
@dipeshranadipeshrana881 Жыл бұрын
Yes but it is for user satisfaction. That according to his/her input program displays correct information
@rohitupasani32396 ай бұрын
I have a question: what if we change the size of the array rather than 10 which you have declared in the video what will happen if we change it to any other size , will it give the wrong output or will it work fine
@onaspnet3 жыл бұрын
function hasDuplicates(num) { var digits = []; while(num > 0) { digits.push(num % 10); num = Math.floor(num / 10); } digits.sort(); for(var i = 0; i < digits.length - 1; i++) { if(digits[i] == digits[i+1]) return true; } return false; }
here's the code to print how many times a digit is repeated, hope it helps. #include int main() { //create array full of zeros int seen[10]={0}, i; int N; printf("pls insert a number "); scanf("%d", &N); int rem; //while loop to count how many times a number while (N>0) { rem=N%10; seen[rem]=(seen[rem]+1); N=N/10; } for (i=0; i
@universalstarcpu95223 жыл бұрын
Have u compiled it ? Does it produced the crct result?
@ozgeylmaz8685 Жыл бұрын
very good example thank you for the videos
@shreyasingh2223 жыл бұрын
Thanks Sir for this video... it's really helpful...
@e-ponnobangladesh53875 жыл бұрын
we need data structure and algorithm from you.
@Randibaaj_sala4 жыл бұрын
kar diya hai lavde
@adithya38904 жыл бұрын
@@Randibaaj_sala swag😂😂
@Godl_Damon4 жыл бұрын
hi guys are you alive in this covid period 😂😂🤣😂😂😅☺😅🤣😂🤣😅🤣😂😅🤣😂🤣😅
@sambhavsrivastava60153 жыл бұрын
@@adithya3890 tmhre amma ki jai.
@alkapathak595 жыл бұрын
thank you for detailed explanation.
@AmanaFathima-qt9ud6 ай бұрын
please upload more questions its highly helpful
@kumarshwetank12563 ай бұрын
Pw c programming array waha vi kraye h bhot question
@TYGAMatt4 жыл бұрын
Great teacher
@VashishtArora2 жыл бұрын
Instead of assigning the value 1 shouldn't we assign the remainder in the array and break if the value is not equal to 0?
@dipeshranadipeshrana881 Жыл бұрын
Of course we can. I am also thinking about it.
@mayankshigaonker77254 жыл бұрын
Hello Sir, I solved this problem before watching your solution and this is what I came up with. #include int main() { int num, nums[5], dup = 0; //Input stage printf("Please enter a five digit number: "); scanf("%d", &num); // Processing stage int temp = num; //Transferring each digit of num to the array nums for(int counter = 0; counter < 5; ++counter) { nums[counter] = temp % 10; temp /= 10; } //The algorithm for(int counter = 0; counter < 5; ++counter){ for(int counter1 = (counter + 1); counter1 < (5 - counter); ++counter1) if(nums[counter] == nums[counter1]){ dup = 1; break; } if(dup) break; } //Output stage if(dup) printf("%d has a repeated number", num); else printf("%d does not have a reapeated number in it", num); return 0; } BTW I your program is better than myn because of obvious reasons:)
@someshkarmakar472 жыл бұрын
Great. Thanks 😌
@universalstarcpu95223 жыл бұрын
Can anyone tell 1)the prgrm to know what are the digits that are repeated in the given number? 2)the prgrm to know which digit repeated and how many times it is repeated in the given number?
@mdzaid38803 жыл бұрын
#include int main() { int seen[10] = {0}, rec[10] = {0}; int N, rem; printf("\tenter the number : "); scanf("%d", &N); while (N > 0) { rem = N % 10; if (seen[rem] == 1) { rec[rem] = rec[rem] + 1; } else { seen[rem] = 1; } N = N / 10; } for (int i = 0; i < 10; i++) { if (rec[i] > 0) { printf(" \t%d is repeated %d times.", i, rec[i] + 1); } } return 0; }
@NaveenKumar-li7tl3 жыл бұрын
excellent teaching Thank for helping sir!
@SportsGyan_4 жыл бұрын
What will be the output if value is 50 At last after if condition value of N =5 , which is greater than 0 so output is yes..but there is no repetition
@juanmoscoso03 жыл бұрын
it will divide 5 by 10 and give 0
@A-M-A-N-G3 жыл бұрын
What if when number is repeated more than once ...how we can calculate its length
@sandysandy32875 жыл бұрын
Sir ......if a=10; x=a++; What is the value of x here ??
@alkapathak595 жыл бұрын
since it is a post fix expression ,value of x =10, as the value is assigned before increment is done on ' a '.
@sandysandy32875 жыл бұрын
@@alkapathak59 thanks
@mhmdfathi67805 жыл бұрын
a=11
@tchgs11zdok154 жыл бұрын
@@mhmdfathi6780 a yeah, but x=10
@mdzaid38803 жыл бұрын
Bhai , a=10; In case of x=a++; x=10 but a =11. cause of post increment of value of a. But for x=++a; we get, x=11 and a = 11.cause of pre increment of value of a.
@Aabara_ka_dabara Жыл бұрын
new approach to this Question..😄
@ssr69482 жыл бұрын
beautiful solution sir.
@ilyasmouhtadi1987 күн бұрын
great job
@neemakalpure3 жыл бұрын
Best explaination ever.
@jaideepsharma69453 жыл бұрын
wow what a solution sir ji
@jaideepsharma93533 жыл бұрын
ma man jaspr!
@HelloWorld40408 Жыл бұрын
Thank You Sir
@varshaaggarwal90405 жыл бұрын
Sir i am not able to design algorithms of programs, like the program explained in this video. What should I do?
@priyanshtiwari83174 жыл бұрын
refer geeksforgeeks
@spoofer91133 жыл бұрын
yeah even I did made a program to get this output but my code and way of thinking was not like this. I don't know what to do
@chacho2340 Жыл бұрын
great idea sir
@muhammadsharif91922 жыл бұрын
amazing one sir
@annamalai31rv995 жыл бұрын
Thank you neso
@marbles55902 жыл бұрын
not applicable if we enter such number like 0091 for instance. Answer would be "No" despite the repeating zeroes
@priyankasingh-qi3wl4 жыл бұрын
Thank you sir..
@accessdenied93933 жыл бұрын
Another method using bruteforce instead of math: int main(void) { int array[] = {10, 20, 30, 40, 10, 10, 70, 80, 90}; int count = sizeof(array) / sizeof(array[0]); for (int i = 0; i < count-1; i++) { for (int j = i+1; j < count; j++) { if (array[i] == array[j]) { printf("%d ",array[i]); } } } return 0; } Say you've got 9 items in an array and want to compare each pair of items: start with the first one, and compare it to each of the other 8 items in the array. That's 8 comparisons so far. Then move to the second one. No need to compare it to the first item, you already did that, so compare to each of the remaining 7 items. Repeat this process and you'll end up with 8+7+6+5+4+3+2+1=36 comparisons. And that's just what the code above does
@adamlupu58852 жыл бұрын
This is what came to me at first too..but the time complexity is way worse.
@souvikpaul72502 жыл бұрын
What if I enter '1070'? In this case 0 is repeated, but if 0 is the reminder, then it won't iterate... It should exit the loop, but it does complete it's task, why?
@priyalamba52882 жыл бұрын
it will iterate for sure because we are checking whether 1 is stored in arr[rem=0] or not...so there is no effect of rem being 0 in the first case but when the rem again comes out to be zero..it will come out of the loop as the value at arr[0] is already equal to 1 because of the first rem. that's why this code is able to check all the positive integera.
@praveen92025 жыл бұрын
Sir please complete power systems please .....i eagerly waiting to have grip on it
@mayurborse60963 жыл бұрын
I also thought 💭 , if given no is like 35385 or any other then what logic we have to add ? Many of your subscribers also want it's solutions as you take attention to comments . So I kindly request you to give ethier a small reply from you or a presentation .
@vivektripathi98633 жыл бұрын
then applay for loop in for loop with the same logic use nested if situation you will get the output how many time a digit has been repeated
@vivektripathi98633 жыл бұрын
#include int main() { int num,rem,i,j,k,num2,count=0; printf("enter the number :"); scanf("%d",&num); printf("enter the number which you want to check in given digit"); scanf("%d",&num2); while(num!=0) { rem=num%10; //it will give us remender means last digit of a line if(num2==rem) count++; num=num/10; } printf("_______________ "); printf("here %d occure in %d time in digit",num2,count); return 0; }
@pankajkesharwani8088 Жыл бұрын
@@vivektripathi9863 how bro i am not getting that
@vivektripathi9863 Жыл бұрын
@@pankajkesharwani8088 what error you are facing bro ?
@qandos-nour4 жыл бұрын
very nice ans smart program thanks
@yahia13554 жыл бұрын
this is very smart!
@varunvishal Жыл бұрын
When I am using a 11 digit number such as 12345678901 even after using unsigned long long int data type it is messing up the result. What can be the reason for this?
@Atrainn2342 жыл бұрын
Thank you!
@huychu013 жыл бұрын
In line 7, if i write : scanf("%d ", &N); , then i must type 2 times the number, the program will run. I don't know why ?
@tanuja28535 жыл бұрын
in previous video you said that ;;;;;if we take a[10] it will take only 10 numbers ::::but in the above video i took seen[4] but entered value is 6 digit program executes and why should we tak that seen[10]={0}
@nazmapervin71984 жыл бұрын
Thank you sir it was a great video.But when i enter any large number in my program, then it does not work properly. I entered a number which has more than 10 digits. Is it because of that?
@DUALE04 жыл бұрын
int has a specific size of byte upto which it can store a value. For long digit numbers, try long int
@learnwiththapa28863 жыл бұрын
Sir, in Part 2 explaination, 2%10 will give 0 as a remainder which will be returned to rem variable. or am I wrong, please help me with this.
@ttobg3 жыл бұрын
2 divided by 10 would be 0, and you are left with 2
@learnwiththapa28863 жыл бұрын
@@ttobg % (modulus) operator returned the remainder value to the variable means I am confused if it is so, variable rem will get value 0.. 2 here is dividend not a remainder..🤔
@agambhatia64963 жыл бұрын
@@learnwiththapa2886 remember modulus operator gives the last digit of a number and if the number is itself a single digit then it will return that particular single digit.
@lokeshjoshi5672 Жыл бұрын
//An alternate method #include int main() { int a[5],i,j,count=0; printf("Enter 5 numbers"); for(i=0;i
@anupamsandeep59403 жыл бұрын
Good Logic sir
@suhanagupta96242 жыл бұрын
Thank you sir .🙂
@aakankshagarg84235 жыл бұрын
Really gud video.... Keep doing this..
@hansbhai74534 жыл бұрын
yes,its true
@nabeelali21785 жыл бұрын
In may task having the same problem but i must count every number and print it and how many times it's been repeated
@mauryaashish18653 жыл бұрын
You are best sir! 😊
@sarapreethi72005 жыл бұрын
Why we using the condition in if statement as n>0
@naurinsultana11664 жыл бұрын
Can we check which digits are repeated and how many times?
@mdzaid38803 жыл бұрын
#include int main() { int seen[10] = {0}, rec[10] = {0}; int N, rem; printf("\tenter the number : "); scanf("%d", &N); while (N > 0) { rem = N % 10; if (seen[rem] == 1) { rec[rem] = rec[rem] + 1; } else { seen[rem] = 1; } N = N / 10; } for (int i = 0; i < 10; i++) { if (rec[i] > 0) { printf(" \t%d is repeated %d times.", i, rec[i] + 1); } } return 0; }
@sushantxtj3727 Жыл бұрын
Thanks
@dachinoloko76243 жыл бұрын
At first I tried it didn't work and I modified the part 3 section and after that still not working, I switched it back to the original as below: If(N>0) printf("Yes"); else printf("No"); it works. but then I thought of another method like this: if (N==0) puts("No"); else puts("Yes"); which is much simpler and it works too. The reason why if u key in 000 or 001 and so anything with 0 in the beginning followed by a value, compiler will ignore the zero and read it as 1 in case of 01, 001, try putting 0011, and it will be understood as 11 and the output will be "YES MACHA!" this is a repeated number
@asharya53113 жыл бұрын
Yes correct! Even I experienced it! int main() { int num,rem; int a[10]= {0}; int count = 0; char c; printf("Enter the number: "); scanf("%d",&num); for( num; num > 0; num/=10) { rem = num%10; if(a[rem] == 0) a[rem]++; else a[rem]++; } for(int i = 0; i=2) { printf("%d is repeated %d times ", i,a[i]); count++;} } if(count == 0) printf("NO digits are repeated "); return 0; } I wrote the above code to check which digit is repeated, for numbers like 000011 it does take into consideration the 0 digit! Do you know the solution?
@ismaail86202 ай бұрын
if you give the n = 00; the output gonna be no and thats incorrect
@captainjow15184 жыл бұрын
I also solved it but mine is kinda weak since I needed to know how many digits is the input and then take it one by one and do a comparison but yours is much more convenient and smarter , I feel dumb
@vivektripathi98633 жыл бұрын
#include int main() { int num,rem,i,j,k,num2,count=0; printf("enter the number :"); scanf("%d",&num); printf("enter the number which you want to check in given digit"); scanf("%d",&num2); while(num!=0) { rem=num%10; //it will give us remender means last digit of a line if(num2==rem) count++; num=num/10; } printf("_______________ "); printf("here %d occure in %d time in digit",num2,count); return 0; }
@nabiurrahman66373 жыл бұрын
How do you explain that below program? #include #include int main(){ char s[1000]; int x,i,count[10]={0},a=0; gets(s); for(i=0;i
@thejareddy43805 жыл бұрын
Sir neso acadamy will upload network theory classes or not sir please reply sir We are prolonged waiting for NT classes
@ranvijayabharadwaj76234 жыл бұрын
Sir if we put there the no 1204 then sir it will break because of 0 then sir this is wrong
@user_at1805 жыл бұрын
sir,this program doesnt give the proper output,if n=non repeated digits,wht op im getting is yes only
@yashwanthrajlakumarapu97384 жыл бұрын
me 2
@vivektripathi98633 жыл бұрын
@@yashwanthrajlakumarapu9738 #include int main() { int num,rem,i,j,k,num2,count=0; printf("enter the number :"); scanf("%d",&num); printf("enter the number which you want to check in given digit"); scanf("%d",&num2); while(num!=0) { rem=num%10; //it will give us remender means last digit of a line if(num2==rem) count++; num=num/10; } printf("_______________ "); printf("here %d occure in %d time in digit",num2,count); return 0; }
@Meander_Man4 жыл бұрын
Sir if entered digit is 00 this will not work
@saikrishna90945 жыл бұрын
Sir make network theory videos
@andistheinforitbutso75132 жыл бұрын
We can manipulate this code and can find out:- 1. Which number is repeated how many times? 2. We can even used it for alphabets. 3. We can build a program to find out repeated alphanumeric names.
@udaykiranbade78722 жыл бұрын
Whait if num 1234321...... Means after 4 Then it comes to the 3 then if condition satisfies break excute then other numbers are repeated or not we can't find... 😭😭😭
@rishabhkalyani6045 жыл бұрын
what's happen if i input the number 1206? you take the seen array in which all the entries are zero, so in the second comparison of digits the loop will break but zero is not repeating in number. then what should we do?
@sabitharavichandran33915 жыл бұрын
he is checking for 1 and not whether the value is same
@rishabhkalyani6045 жыл бұрын
Ohh! ya ya ya Thank you
@hil4493 жыл бұрын
aww, nice solution. Im so stupid, I straight up read the number as a string of characters and looped through the string checking if we have repeated chars lmao
@jameswen-o3v Жыл бұрын
Please help me,my English is bad,where does the two at 4:41 come from? Can anyone help me, I know this question 😂is kind of stupid 😢
@jameswen-o3v Жыл бұрын
All right, I‘m good now,thanks
@dnegi46913 жыл бұрын
Sir how can it be compiler u didnt declare rem
@psykjavier4 жыл бұрын
in this video we used the bloom filter and a kind of hash table isn't ?
@ravirajsinghsisodiya6120 Жыл бұрын
Thank0--you
@biswarupsou51444 ай бұрын
If the number input is 1000 It won't be >0
@BruteForceHS3 жыл бұрын
what is the level of this problem?
@Rra1328 ай бұрын
How to know when to use loops 😢. And when to use n%10 like that thing
@topgemaldo69644 жыл бұрын
Excellent 👍👍👍👍
@true41894 жыл бұрын
Thank u
@chinnanachiappanrm252710 ай бұрын
sir will this code work for 9006
@hamzaeIalaoui4 жыл бұрын
Please data structures in C
@sofiullahiqbalkiron68185 жыл бұрын
Love You
@jaibundelkhand70774 жыл бұрын
Sir how can we find which digits are repeated in input value
@arjund13664 жыл бұрын
Before break Put seen[rem]=2; Then add a for loop at the end to check seen[i] =2