Udemy
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
C programming Part 1: Logic Building for Competitive Coding

C programming Part 1: Logic Building for Competitive Coding

Simple, Conditional Construct, Loop Construct
Created byVarsha Patil
Last updated 4/2026
English

What you'll learn

  • Develop logical thinking skills to analyze problems and convert them into structured algorithms and flowcharts.
  • Apply problem-solving techniques to translate real-world problems into C programming statements and programs.
  • Demonstrate proficiency in C programming constructs such as variables, control structures, functions, and arrays to build efficient solutions.
  • Design and implement programs that solve computational problems using step-by-step logical reasoning.
  • Debug and evaluate C programs to ensure correctness, efficiency, and optimized performance.

Course content

1 section • 5 lectures • 1h 26m total length
  • Introduction0:47

    Online Coding Platforms

    • HackerRank

    • LeetCode

    • CodeChef

    • GeeksforGeeks

    • Codeforces

    ? Online IDE / Compiler Platforms

    • Replit

    • JDoodle

    • OnlineGDB

      ? Offline Tools (for local practice)

    • Visual Studio Code

    • Code::Blocks

    • Dev-C++

  • Simple Statement C Programs33:31

    Exercise 1: Input an integer number. If it is even, print "Even number".

    Exercise 2: Input a student’s marks. If the marks are greater than or equal to 40, print "Pass", , “Great”.

    Exercise 3: Input an age. If the age is 18 or above, print "Eligible to Vote".

    Exercise 4: Input a temperature value. If the temperature is above 30, print "Hot Day", “Need of AC”, “Icecream is must”

    Exercise 5: Input a number. If the number is divisible by 5, print "Multiple of 5".

    If-else

    Exercise 1: Write a program to input an integer and print whether it is a single digit integer or double digit integer or three digit integer or more than three digit integer.

    Exercise 2: Write a program in C to input the points scored by a player. If the score is greater than or equal to 5, store 'W' (Winner) in a variable named result. Otherwise, store 'R' (Runner) in result. Finally, print the value of result.

    Exercise 3: Write a program in C to input the coordinates of a point (x, y). Determine and display whether the point lies on the X-axis, Y-axis, the Origin, or anywhere else in the Plane.

    Exercise 4: Write a program in C to input the coordinates of a point (x, y). Determine and display whether the point lies at the Origin, on the X-axis, on the Y-axis, or in any of the four quadrants of the coordinate plane.

    Exercise 5: Write a program in C to input the coordinates of a point (x, y) and the radius r of a circle centered at the origin (0, 0). Determine whether the point lies inside the circle, on the circle, or outside the circle.

    Exercise 6: Write a program in C to input two alphabets c1 and c2. Display the values of c1 and c2, and also determine and display the largest alphabet in terms of ASCII value.

    Exercise 7: Write a program to input the basic salary (bs) of an employee.

    Calculate:

    HRA = 24% of bs     DA = 31% of bs        Special Allowance = 10% of bs if bs <= 10000, otherwise 0.

    Finally, calculate the total salary as bs + HRA + DA + Special Allowance. Print all the values.

    Exercise 8: Write a program to input a character in ch and check whether it is a lowercase vowel (a, e, i, o, u) or a consonant. Display the result.

    Exercise 9: Write a program to input a character in ch. Convert it into lowercase if it is uppercase, otherwise convert it into uppercase if it is lowercase. Print both the original and converted character.

    Exercise 9: Write a program to input two characters ch1 and ch2. Check and print the larger character according to their ASCII codes. Assume that both characters are not the same.

    Exercise 10: Write a program to input roll number and marks obtained in three subjects by a student.

    Compute total marks and percentage. Print roll number, marks in three subjects, total marks, percentage, and division using the following criteria:

    Exercise 11: A bookstore is offering festival discounts based on the total cost amount. Write a program that: Takes the total cost amount as input from the user. Computes the discount based on the following criteria. Calculates the net amount to be paid after applying the discount. Prints the total purchase amount, discount amount, and the net amount to be paid by the customer.

    Exercise 12: A company allots commission to the salesmen on the basis of the total sale using the criteria given below:

    Total sale amount                                    Commission on total sale amount

    <=10000.0                                                   3%

    > 10000.0 and <= 25000.0                       11%

    > 25000.0 and <= 50000.0                       20%

    > 50000.0                                                     25%

    Write a program to input the salary of the salesman and total sale amount. Compute the commission on total sale amount using the table given above. Compute the total salary (salary+commission) and print the sale amount, commission and total salary.



  • Lecture 3: Conditional Statement if9:52
  • Lecture 4: Conditional if -else and Nested if else Part a25:43
  • Lecture 5: Conditional if -else and Nested if else Part b16:18

Requirements

  • Basic computer knowledge, logical thinking skills, and a willingness to learn programming; no prior coding experience required.

Description

This course module focuses on developing strong programming logic through three fundamental constructs: simple, conditional, and loop constructs. In the simple construct, learners understand how to write basic statements, perform calculations, and execute programs step by step. They gain clarity on variables, data types, operators, and input/output operations, which form the foundation for logical thinking and problem understanding.

The conditional construct introduces decision-making using statements like "if," "if-else," and "switch." Students learn how to handle different scenarios and control the flow of execution based on given conditions. This enhances their ability to design solutions where multiple outcomes are possible and improves analytical thinking.

The loop construct covers repetition using for, while, and do-while loops. Learners practice writing programs that execute repeatedly until a condition is met, which helps in improving efficiency, reducing redundancy, and solving complex problems effectively.

Through a variety of programs based on these constructs, students gradually build strong logical reasoning and problem-solving skills. The focus is on hands-on practice and real-world problem solving, enabling learners to convert real-life problems into structured programs with clarity and confidence. This course is highly beneficial for placements, internships, competitive coding, and higher studies, as it strengthens core programming fundamentals required in technical interviews and advanced computing domains.

Who this course is for:

  • Basic computer This course is designed for beginners, students, and anyone interested in developing logical thinking and learning C programming from scratch.knowledge, No prior programming experience is required, Willingness to learn and practice coding