Today I built something simple but powerful — a Number Converter in C that can convert values across different number systems: ✅ Binary → Decimal ✅ Binary → Octal ✅ Octal → Binary ✅ Octal → Decimal ✅ Decimal → Binary ✅ Decimal → Octal It might sound basic, but implementing this logic without any built-in math library really helped me strengthen my understanding of number systems, loops, and base conversions. While working on it, I made sure every step (from binary to decimal calculation to octal conversion) followed manual bitwise-style logic using just loops and base multipliers — no shortcuts. #CProgramming #Developer #LearningByBuilding #SoftwareEngineer #DSA #LogicBuilding #CodingJourney
Built a Number Converter in C with manual logic
More Relevant Posts
-
💻 #Program3 – Prime Number Checker & Range Finder Today’s coding challenge focuses on mathematical logic and optimization 🧮 I built a C program that lets users: 1️⃣ Check if a number is prime or not 2️⃣ Print all prime numbers within a given range The program uses modular arithmetic and checks divisibility only up to the square root of each number — a neat optimization that improves performance ⚡ It also handles invalid inputs (like reversed ranges) and counts how many primes were found. 🧠 Concepts practiced: Conditional statements (switch, if-else) Loops and function calls Boolean logic (true/false) Efficient use of sqrt() for prime testing Each challenge strengthens logic and problem-solving — one program at a time 💪 #100DaysOfCode #CProgramming #LearningByDoing #CodingChallenge #ProgrammersJourney #ProblemSolving #CodeNewbie
To view or add a comment, sign in
-
-
🚀 Today I practiced one of the most important Linked List problems — Sorting a Linked List efficiently. Instead of converting the list into an array (which increases extra memory usage), I implemented Merge Sort directly on the linked list. 🔍 Why Merge Sort for Linked List? Linked lists don’t have random indexing. Merge Sort works naturally by rearranging pointers. No need of extra space for arrays. 🎯 Result: Time Complexity: O(n log n) Space Complexity: O(log n) due to recursion Stable & Clean Solution 💡 What I learned: Using slow–fast pointer technique to find the middle of the list. Splitting the linked list into two halves efficiently. Merging two sorted linked lists without extra memory. Writing cleaner, structured logic improves readability a LOT. Everyday small progress really compounds. Trying to solve at least one challenge daily 💪 #ConsistencyWins #leetcode #dsa #linkedlist #algorithms #programming #cpp #softwareengineering #codingjourney #learningeveryday #100daysofcode
To view or add a comment, sign in
-
-
🚀 LeetCode POTD — 2169. Count Operations to Obtain Zero 🎯 Difficulty: Easy | Topics: Simulation, Math, Loops 🔗 Solution Link: https://lnkd.in/g5BzsmNK Today’s #LeetCode Problem of the Day was a quick and straightforward one — solved it within a minute ⏱️ The task was simple: Given two non-negative integers num1 and num2, repeatedly subtract the smaller number from the larger one until either becomes 0. 🧠 Approach: Initialize a counter res = 0. While both numbers are non-zero: If they’re equal → one more operation is enough, return res + 1. Otherwise, subtract the smaller from the larger and increment the counter. 🕒 Complexity: Time: O(max(num1, num2)) Space: O(1) 💡 Takeaway: Not every problem tests complexity — some test clarity of logic and speed of thought. Solving simple problems fast helps sharpen your problem-reading instincts. #LeetCode #ProblemOfTheDay #DSA #CodingChallenge #LogicBuilding #EasyProblem #SoftwareEngineering #Programming #100DaysOfCode #CodingJourney #LearningInPublic #TechCommunity
To view or add a comment, sign in
-
-
🎯 LeetCode Daily – Combination Sum IV (Day 125) Today’s problem was a powerful exploration of Dynamic Programming with sequence-based combinations - Combination Sum IV. ✅ My Approach: 🔹 Problem – Combination Sum IV: • The goal was to find the number of possible ordered combinations that sum up to a given target using elements from an array. • Implemented Memoization (Top-Down DP) to recursively explore all ways to reach the target, caching results to prevent recomputation. • Then optimized with Tabulation (Bottom-Up DP), where each state dp[i] represents the number of combinations that sum to i. • For every value from 0 to target, iterated through all numbers and accumulated valid combinations. 🧠 Key Insight: Unlike the traditional Subset Sum or Coin Change problems, this problem treats order as significant, making it a classic case of permutation-based DP. The key is understanding how smaller sub-targets build up to form the total - a perfect demonstration of the power of recursive relationships. 📊 Time Complexity: O(N × Target) 📦 Space Complexity: O(Target) #LeetCode #DSA #DynamicProgramming #Combinatorics #ProblemSolving #DailyCoding #LearningInPublic #Day125
To view or add a comment, sign in
-
-
Recursive Logic That Converts Decimal to Octal — Explained Simply! Today, while revising recursion in C, I explored how a simple function can convert a decimal number into its octal representation using recursion. Here’s the code 👇 #include <stdio.h> void fun(int a) { if(a >= 8) fun(a / 8); printf("%d", a % 8); } int main() { int a = 25; fun(a); return 0; } 🧠 How it works: The function fun() keeps dividing the number by 8 until it becomes smaller than 8. Then, it prints the remainders during the “unwinding” phase of recursion. For a = 25, the output is 31 — which is the octal equivalent of 25. ✨ Key takeaway: Recursion is not just about repeating — it’s about understanding the flow of function calls and returns. #CProgramming #Recursion #ProgrammingBasics #LearnCoding #CodeEveryday #LinkedInLearning
To view or add a comment, sign in
-
🧩 Day 64 of #100DaysOfCode 🧩 🔹 Problem: Remove All Adjacent Duplicates in String – LeetCode ✨ Approach: Used a stack-based approach to efficiently remove adjacent duplicates. For each character, if it matches the stack’s top element, pop it — otherwise, push it. A simple yet powerful way to process strings in O(n) time while maintaining clean logic. ⚡ 📊 Complexity Analysis: Time Complexity: O(n) — each character is processed once Space Complexity: O(n) — for the stack and output string ✅ Runtime: 23 ms (Beats 54.52%) ✅ Memory: 45.26 MB (Beats 85.43%) 🔑 Key Insight: Sometimes, solving problems isn’t about brute force — it’s about using the right data structure to make every step count. 💡 #LeetCode #100DaysOfCode #ProblemSolving #DSA #Stack #StringManipulation #CleanCode #CodingChallenge #AlgorithmDesign #LogicBuilding #CodeJourney #Programming
To view or add a comment, sign in
-
-
🚀 Day 36/100 – Data Structures & Algorithms Journey 🚀 Today, I learned about one of the most important concepts in DSA — Time and Space Complexity ⏱️💾 Understanding how efficient an algorithm is helps us write better, faster, and optimized code. 🔹 Key Concepts I Covered: What is Time Complexity and how it measures algorithm speed What is Space Complexity and how it measures memory usage Common notations: Big O (O), Omega (Ω), and Theta (Θ) Analyzing best, average, and worst-case scenarios Real-world examples of optimizing code efficiency 💡 Takeaway: Writing correct code is good, but writing efficient code is what makes a great developer! ⚡ #Day36 #100DaysOfCode #DSA #TimeComplexity #SpaceComplexity #BigO #CodingJourney #ProblemSolving #Programming #SoftwareEngineering #TechLearning
To view or add a comment, sign in
-
✅Day101/160 #GFG160DAYS DSA CHALLENGE ✅ Today's challenge: Next Greater Elements 🔍 Approach To find the Next Greater Element for each element in an array, I used a stack-based approach while traversing the array from right to left. 1. Initialize an empty stack and a result vector. 2. Traverse the array from the end: While the stack is not empty and the top element is less than or equal to the current element, pop the stack. If the stack becomes empty, the next greater element is -1. Otherwise, the top of the stack is the next greater element. 3. Push the current element into the stack. This approach efficiently determines the next greater element for each array element in a single pass. 💡 Key Learning Points Learned how to effectively use a stack to optimize searching problems. Understood the importance of reverse traversal in problems involving future comparisons. Practiced clean and efficient O(N) time complexity solutions for array-based problems. Reinforced the concept of monotonic stacks, a common pattern in competitive programming. ⏱ Complexity Analysis Time Complexity: O(N) — each element is pushed and popped at most once. Space Complexity: O(N) — for the stack and output array. #DSA #ProblemSolving #Coding #GeeksforGeeks #Stack #C++ #NextGreaterElement #LearningEveryday
To view or add a comment, sign in
-
-
🎯 #Day10 of #30DaysOfDSA Challenge 🚀 Today I explored how to Evaluate a Postfix Expression using Stack in C 💻 Stack plays a key role in solving expression problems using the LIFO (Last In, First Out) principle 🧠 🧩 Concept Recap: 👉 In Postfix (Reverse Polish Notation), operators come after operands. 👉 Stack helps store operands and perform operations efficiently. 💡 Example: Expression: 231*+9- Steps: 3 × 1 = 3 2 + 3 = 5 5 − 9 = −4 ✅ ⚙️ Language: C Programming 📚 Topic: Stack Implementation 🚀 Concept Used: Expression Evaluation Code 🖇️ : https://lnkd.in/eJQigf7m 💬 Every day, I’m learning something new and getting closer to mastering Data Structures & Algorithms 💪 #Day10 #30DaysOfDSA #CProgramming #DSA #Stack #PostfixExpression #ReversePolishNotation #CodingChallenge #LearnToCode #ProgrammersLife #CodeNewbie #StudentDeveloper #EngineeringStudent #TechLearner #CodingCommunity #100DaysOfCode #ProgrammersOfIndia #TechEnthusiast #CodeEveryday #DSAwithC #ProgrammersJourney #ProblemSolving #ComputerScience #DataStructures #Algorithm #CDeveloper #TechSkills #LearnCoding #FutureEngineer #SoftwareDeveloper #CodeLife 👨💻🔥
To view or add a comment, sign in
More from this author
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development