Functions are blocks of reusable code. If you have a piece of code that is used in multiple places of your program, you can put it in a function and use it instead of the same code block. A function can take values and it can return one result.
ReadNormally, we use \n in a printf statement to print one new line. This is the most commonly used method in the C programming language. We have a couple of other ways to print one new line in C without using \n. In this blog post, I will show you two different ways to do that. Let's have a look :.
ReadThree types of logical operators are available in C. Logical AND (&&), logical OR (||) and logical NOT (!). Logical operators are used to test multiple conditions. It returns true(1) or false (0)based on the conditions. In this tutorial, I will show you these logical operators with an example for each.
ReadLet me show you how to write a C program to find the square and cube of a number. The program will take the number as input from the user, find out the square, cube, and print out the result to the user. We can use functions or we can directly calculate and print the values.
ReadFinding out the trigonometric value like sine, cosine or tangent will be hard if we don’t use any package or library. Almost every programming language provides trigonometric functions. For python, these are defined in the math module. math module in Python provides different types of mathematical functions defined by the C standard. In this post, I will show you the list of all trigonometric functions defined in python math module with examples :.
ReadUsing enumeration can improve the readability of your code. Enumeration is a set of key-value pairs with each key is a symbolic name bound to its value. You can use the symbolic name in your code using enumeration to make it more readable.
Readmath module in python provides two different methods for a degree to radian and radian to degree conversion. Degree and radian are used for angle measurement and conversion of one to another are frequently used in applications like weather apps. You can write your own function to do the conversion but the math module already provides these functions. In this tutorial, I will show you how to use these math module functions.
ReadWe can print one inverted right-angled triangle using two loops. In this C++ tutorial, we will use two for loops. The program will take the height of the triangle as input from the user and print out the triangle.
ReadIn this C++ tutorial, we will learn how to print a half pyramid or right-angled triangle using numbers or using any character. The program will take the height of the triangle as an input from the user. With this example, you will learn how to read user inputs, how to print a message, how to use a separate function and how to use for loop in C++.
ReadIn this tutorial, we will learn how to print one square hollow pattern in C++ using user input values. This is a square with hollow inside. We will write one program that will take the size of the square and the character to print the square as user inputs. I will show you two different ways to solve it.
Read