title-img


"Hello World!" in C

Objective: In this challenge, we will learn some basic concepts of C that will get you started with the language. You will need to use the same syntax to read input and write output in many C challenges. As you work through these problems, review the code stubs to learn about reading from stdin and writing to stdout. Task: This challenge requires you to print Hello World! on a single line, and then print the already provided input string to stdout. If you are not familiar

View Solution →

Playing with Characters

Objective: This challenge will help you to learn how to take a character, a string and a sentence as input in C. To take a single character ch as input, you can use scanf("%c", &ch ); and printf("%c", ch) writes a character specified by the argument char to stdout char ch; scanf("%c", &ch); printf("%c", ch); This piece of code prints the character ch. You can take a string as input in C using scanf(“%s”, s). But, it accepts string only until it finds the first space. In order to

View Solution →

Sum and Difference of Two Numbers

Objective: The fundamental data types in c are int, float and char. Today, we're discussing int and float data types. The printf() function prints the given statement to the console. The syntax is printf("format string",argument_list);. In the function, if we are using an integer, character, string or float as argument, then in the format string we have to write %d (integer), %c (character), %s (string), %f (float) respectively. The scanf() function reads the input data from the console

View Solution →

Functions in C

Objective: In this challenge, you will learn simple usage of functions in C. Functions are a bunch of statements grouped together. A function is provided with zero or more arguments, and it executes the statements on it. Based on the return type, it either returns nothing (void) or something. A sample syntax for a function is return_type function_name(arg_type_1 arg_1, arg_type_2 arg_2, ...) { ... ... ... [if return_type is non void] return

View Solution →

Pointers in c

Objective: In this challenge, you will learn to implement the basic functionalities of pointers in C. A pointer in C is a way to share a memory address among different contexts (primarily functions). They are primarily used whenever a function needs to modify the content of a variable that it does not own. In order to access the memory address of a variable, val, prepend it with & sign. For example, &val returns the memory address of val. This memory address is assigned to a pointer and

View Solution →