- 22
- 224 639
Tech Travel
India
Приєднався 23 жов 2020
In this channel information about science and technologies will be given along with tech reviews and information about digital world and internet of things.
💡 TOPICS IN THIS CHANNEL 💡
• Computer programming, Coding, Programming languages, Tutorials of programming languages, Technology, Tech Info, Education, Tech Secrets, Tech Reviews, Science, Science fiction, Science reality
💡 TOPICS IN THIS CHANNEL 💡
• Computer programming, Coding, Programming languages, Tutorials of programming languages, Technology, Tech Info, Education, Tech Secrets, Tech Reviews, Science, Science fiction, Science reality
Strivers A2Z DSA Sheet Pattern Series Problem 4 in Java
This video is made for educational purpose in which we are going to solve striver's A2Z dsa sheet from beginning. We are using Java for solving these problems.
#striver #dsa #coding #india #job #freshers #beginners #programming #java
#striver #dsa #coding #india #job #freshers #beginners #programming #java
Переглядів: 20
Відео
Strivers A2Z DSA Sheet Pattern Series Problem 3 in Java
Переглядів 235 місяців тому
This video is made for educational purpose in which we are going to solve striver's A2Z dsa sheet from beginning. We are using Java for solving these problems. #striver #dsa #coding #india #job #freshers #beginners #programming #java
Strivers A2Z SDE Sheet Pattern Series Problem 2 in Java
Переглядів 155 місяців тому
This video is made for educational purpose in which we are going to solve striver's A2Z dsa sheet from beginning. We are using Java for solving these problems. #striver #dsa #coding #india #job #freshers #beginners #programming #java
Strivers A2Z DSA Sheet Problems Pattern Series Problem 1 in Java
Переглядів 645 місяців тому
This video is made for educational purpose in which we are going to solve striver's A2Z dsa sheet from beginning. We are using Java for solving these problems. #striver #dsa #coding #india #job #freshers #beginners #programming #java
❤
Which ide you use for c
codeblocks
This is dev c
Wrong code
if i give n=17, i got output like 17 is not a prime...why..????
Nice 👍👍👍
Gracias bro ❤️
Gracias amigo!!!
Super
Jesus is the only true living GOD Jesus is the only way to heaven Accept Jesus Escape Hell
Jai Shree Ram
@@tech_travel_Jai shree Ram
Jai Shree Ram 🙏 @@tech_travel_
Allahu Akbar☪️🕌
Jesus is the only true living GOD Jesus is the only way to heaven Accept Jesus Escape Hell
Jai Shree Ram 🚩🚩🚩
Guys what does jesus and ram had to do with C programing chill 😅😅😅
😂😂
I don't understand this types of Morons with their fairy tales and kid mentality...
Jai mahakal 🔱🖤🏴🏴
I LOVEE THIS APPROACH!
Here why you taking ( count==2) this step is not understanding
Read the definition of prime numbers you'll understand it.
Is that user-defined function ?
No
Noob haha🤨🤨🤨🤨🤨
Yes it's for noobs only. If you're a pro you shouldn't be watching and commenting(mocking) :)
Every pro was once a noob 😔💔
Nice code but I have a suggestion If you check for(i=1:i<n/2:i++) it will take less time and result will be same
Yes but as this program is for beginners a simple one is good for them.
sqrt(n) is even faster ;)
can you plz explain me its logic plz it helps me alot to understand
Its simple we are running the loop from 1 to the number itself. And we know if a number is divisible by 1 and itself then it is a prime number so when we divide the given number by 1 till the number itself and we keep a counter that is incremented whenever the given number is divided it will increment. So if the counter value is 2 then that means it was only divided by 1 and itself and no other number in between hence it is prime else if the counter value is more than two it means it was also divided by some other number hence it is not prime.
T❤🎉
#include <stdio.h> int main() { int num, i, a= 1; printf("Enter a number: "); scanf("%d", &num); if (num <= 1) { a = 0; } else { for (i = 2; i < num; i++) { if (num % i == 0) { a = 0; } } } if (a) { printf("%d is a prime number ", num); } else { printf("%d is not a prime number ", num); } return 0; }
thank youuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu
If you are running the loop from 2 then why to run till n-1? Just run till n/2 it will be optimized.
@@tech_travel_ i excluded 1 cause its not a prime number but it was not necessary as I have already mentioned 1 is not a prime number .I did not get the second part 🙂
@@alone7463Here, note that we are looping from 2 to num/2. It is because a number is not divisible by more than its half.
@@gamersghost_ I get it ,thanks but if i use <n its still gonna give me right answer
2 is also a prime number 😮
2 is prime but count is a different value we stored the number in n variable
❤❤❤
It is only for 3 digit not for general
What if i enter 0 or 1 ?? 🙏
It will print only 0 and 1. The loop will not run.
can you do the psuedocode verson in this
Thanks
Welcome
Show the full screen
Nice video it help me in my exams
Happy to help
Output is missing
Sorry output part got cut in the editing.. The program is correct try it yourself you'll definitely get the output...
Make sure to format your code in a nice manner, add a return statement, and add a newline to the end of hello world
Thanks for your comment.. I don't see here any big formatting problem and this program is for absolute beginner so i didn't add the return statement so that they don't get confused or whatsoever... However you can get return statements in all other shorts... Will try to make much cleaner content... ❤
Great!!!
For more short coding videos checkout ua-cam.com/play/PLyHVWchXWnPXZPCLS0MiANUOV_SFfFqYg.html
For more short coding videos checkout ua-cam.com/play/PLyHVWchXWnPXZPCLS0MiANUOV_SFfFqYg.html
For short coding videos checkout ua-cam.com/play/PLyHVWchXWnPXZPCLS0MiANUOV_SFfFqYg.html
For more short coding videos checkout ua-cam.com/play/PLyHVWchXWnPXZPCLS0MiANUOV_SFfFqYg.html
For more short coding videos checkout ua-cam.com/play/PLyHVWchXWnPXZPCLS0MiANUOV_SFfFqYg.html
For more short coding videos visit ua-cam.com/play/PLyHVWchXWnPXZPCLS0MiANUOV_SFfFqYg.html
For more short coding videos visit ua-cam.com/play/PLyHVWchXWnPXZPCLS0MiANUOV_SFfFqYg.html
For more short coding videos visit ua-cam.com/play/PLyHVWchXWnPXZPCLS0MiANUOV_SFfFqYg.html