Skip to content
KnowledgeCity

Data Types in C Programming

Understand how to make decisions in C programming code
Preview the first lesson free — get full access to all 3 lessons.
Course: On-Demand
Beginner Provider Mike McMillan  3 Lessons ·  8m  in Arabic, German, English, Spanish, French, Portuguese, Chinese 

Course Description

This Data Types course covers how to make decisions in C programs using the different types of If statements. All nontrivial programs need to be able to make decisions, such as how a payroll program decides how much to pay an employee based on the number of hours they worked. Making decisions is one of the key constructs of all programming languages, and is vital for problem-solving within your program.

These lessons first discuss how to create relational expressions to generate true and false values once inputs are submitted into your code. You will learn to implement the basic If statement, followed by the more commonly used If-else statement and the If-else If statement. Then we’ll proceed to the Switch statement, how it’s used for more structured decisions that only involve evaluated integral (whole number) data, and how to apply it in such situations.

What You'll Learn

  • Form and use relational expressions to generate true and false values from submitted inputs
  • Implement the basic If statement to make decisions in C programs
  • Apply the If-else and If-else If statement types for more common decision scenarios
  • Use the Switch statement to handle structured decisions involving integral (whole number) data
  • Differentiate between If statements and Switch statements and know when to use each
  • Work with C data types including numeric types, the char type, strings, and how C handles Boolean types

Key Takeaways

  • Making decisions is one of the key constructs of all programming languages and is vital for problem-solving within a program.
  • Relational expressions generate true and false values once inputs are submitted into your code.
  • C provides three If statement forms: the basic If statement, the more commonly used If-else statement, and the If-else If statement.
  • The Switch statement is used for more structured decisions that only involve evaluated integral (whole number) data.
  • All nontrivial programs need to be able to make decisions, such as a payroll program deciding pay based on hours worked.

Frequently Asked Questions

What does this C programming course cover?

It covers how to make decisions in C programs using the different types of If statements, how to create relational expressions that generate true and false values, the basic If statement, the If-else and If-else If statements, and the Switch statement for structured decisions involving integral (whole number) data.

What is the difference between If statements and the Switch statement taught here?

The course teaches the three If statement types for making decisions from relational expressions, while the Switch statement is used for more structured decisions that only involve evaluated integral (whole number) data; you will learn to differentiate between them and when to use each.

What skills will I gain from this course?

The course builds skills in C (Programming Language), C Data Types, C-Based Programming Languages, Interactive C, Modular Programming in C, and Operators in C and C++.

What topics are included in the lessons?

The lessons cover The Numeric Data Types, the Char Data Type and Creating Strings, and How C Handles Boolean Types.

Why is learning to make decisions in C important?

All nontrivial programs need to make decisions, such as a payroll program deciding how much to pay an employee based on hours worked, and making decisions is one of the key constructs of all programming languages and vital for problem-solving within your program.