Break Statement in C/C++

Samual Sam
Published on 08-Oct-2018 12:13:30
Break statement is also a loop control statement. It is used to terminate the loop. As the break statement is encountered, the loop stops there and execute the next statement below the loop. It is also used in switch statement to terminate the case. Here is the syntax of break ... Read More

Continue Statement in C/C++

karthikeya Boyini
Published on 08-Oct-2018 12:11:09
Continue statement is loop control statement. It works opposite the break statement and force to execute the next statements. Here is the syntax of continue statement in C language, continue; Here is an example of continue statement in C language, Example Live Demo #include <stdio.h> int ... Read More

goto statement in C/C++

Samual Sam
Published on 08-Oct-2018 12:09:00
The goto statement is a jump statement. Within a function, it is used to jump from one statement to another. The use of this statement is highly discouraged. It makes the program complex and difficult to trace the control flow of program. It makes hard to modify the program. Here ... Read More

Float and Double in C

karthikeya Boyini
Published on 08-Oct-2018 12:05:31
Float Float is a datatype which is used to represent the floating point numbers. It is a 32-bit IEEE 754 single precision floating point number ( 1-bit for the sign, 8-bit for exponent, 23*-bit for the value. It has 6 decimal digits of precision. Here is the syntax of float ... Read More

strcmp() in C/C++

Samual Sam
Published on 08-Oct-2018 12:01:34
The function strcmp() is a built-in library function and it is declared in “string.h” header file. This function is used to compare the string arguments. It compares strings lexicographically which means it compares both the strings character by character. It starts comparing the very first character of strings until the ... Read More

strcpy() in C/C++

karthikeya Boyini
Published on 08-Oct-2018 11:59:00
The function strcpy() is a standard library function. It is used to copy one string to another. In C language, it is declared in “string.h” header file while in C++ language, it is declared in cstring header file. It returns the pointer to the destination. Here is the syntax of ... Read More

Difference between getc(), getchar(), getch() and getche()

Samual Sam
Published on 08-Oct-2018 11:54:54
All these functions read the character from input and return an integer. The value of EOF is used for this purpose. getc() It reads a single character from the input and return an integer value. If it fails, it returns EOF. Here is the syntax of getc() in C language, ... Read More

printf(), sprintf() and fprintf() in C

karthikeya Boyini
Published on 08-Oct-2018 11:51:23
printf() The function printf() is used to print the message along with the values of variables. Here is the syntax of printf() in C language, printf(const char *str, ...); Here is an example of printf() in C language, Example Live Demo #include<stdio.h> int main() { ... Read More

How to print % using printf()?

Samual Sam
Published on 08-Oct-2018 09:58:26
Generally, printf() function is used to print the text along with the values. If you want to print % as a string or text, you will have to use ‘%%’. Neither single % will print anything nor it will show any error or warning. Here is an example to ... Read More

What is the use of %n in printf()?

karthikeya Boyini
Published on 08-Oct-2018 09:55:59
In C language, %n is a special format specifier. It cause printf() to load the variable pointed by corresponding argument. The loading is done with a value which is equal to the number of characters printed by printf() before the occurrence of %n. Note − It does not print anything. ... Read More
Advertisements