Interview Prep
Interview questions, roadmaps and practice sets
Tutorials
Free tutorials on 30+ topics
Blog
Career guides, skills and interview tips
Free PDFs
Notes, cheat sheets and question banks
Certificates
Free skill tests and course certificates
Tools & Whiteboard
Free tools you can use right in the browser
Practice Tests
Mock tests, MCQs and quick Q&A
Free LMS
Learn on the Uncodemy LMS
Choose the best training program according to your career.
Improve the performance of your business with our innovative Industrial Training Program.
Read More →
Our instructor-led training classes are designed to make you an expert.
Read More →
Real-life case studies are a great way to demonstrate your practical knowledge.
Read More →
Explore blogs, latest technologies and industry updates with practical examples.
Read More →Browse all available training programs and choose the right one for your career.
Read More →Know more about who we are and what we stand for.
Discover our mission to equip individuals with essential IT skills and industry expertise.
Read More →
Free tutorials, interview questions, tools and calculators to help you learn.
Explore →Learn, practice and plan your career — bilkul free.
Book a free video counselling session and pick the right course for you.
Read More →When you’re just starting to learn programming, writing your first few lines of code can feel both
exciting and a little overwhelming. One of the very first programs you'll likely write in C is something
super simple: adding two numbers.
And that’s for a good reason.

Even though it sounds basic, writing a sum of two numbers in C teaches you some of the most important building blocks like variables, input/output, and how code flows. Whether you're self-learning or enrolled in a C Programming Course in Noida, this is one exercise you won’t want to skip.
Let’s break it down step-by-step and see how this tiny program sets the foundation for so much more.
Before jumping into code, it’s important to understand why this seemingly simple problem is crucial:
It’s not just about adding 2 + 3. It’s about learning:
This one program gives you a hands-on feel for how C really works.
Here’s the simplest version of a C program that adds two numbers entered by the user:
#includeint main() { int num1, num2, sum; printf("Enter the first number: "); scanf("%d", &num1); printf("Enter the second number: "); scanf("%d", &num2); sum = num1 + num2; printf("The sum of %d and %d is: %d\n", num1, num2, sum); return 0; }
Sample Output
Enter the first number: 10
Enter the second number: 20
The sum of 10 and 20
is: 30
Explanation:
#includeint add(int a, int b) { return a + b; } int main() { int num1, num2; printf("Enter first number: "); scanf("%d", &num1); printf("Enter second number: "); scanf("%d", &num2); int result = add(num1, num2); printf("The sum is: %d\n", result); return 0; }
This structure makes your code more reusable and neat, which comes in handy when your projects grow.
Explanation:
When writing the sum of two numbers in C, beginners often run into these issues:
Being careful with these little things will save you time (and errors).
Once you’re comfortable with this, a C Programming Course in Noida will guide you to other essential topics like:
This is just the beginning.
Writing a program to add two numbers in C may seem like a baby step, but it’s truly a giant leap toward becoming a real programmer. At first glance, it might feel like you're just working with two numbers but beneath the surface, you're laying the groundwork for understanding core programming concepts like input handling, data types, memory allocation, and output formatting.
This seemingly simple code introduces you to how a program interacts with a user—how to take input, perform a logical operation, and display a meaningful result. These are foundational skills, not just in C programming, but in software development as a whole. Whether it's building a calculator, a banking app, or a machine learning algorithm, it all starts with understanding the flow of logic through basic building blocks.
If you're enrolled in a C Programming Course in Noida, exercises like this aren't just routine tasks. They are your first encounters with real-world logic. These programs prepare your mind to think computationally, to debug, and to build confidence with syntax and structure. Each line you write is a stepping stone toward solving larger, more complex problems like file handling, algorithms, or system-level development.