
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 1339 Articles for C

4K+ Views
ProblemWhat are the limitations of C Programming when compared to other programming languages?SolutionC Language prevents or prohibits the concepts of object-oriented programming language like inheritance, polymorphism, encapsulation, and data abstraction.C programming language does not detect errors for every line of coding, it will check the bugs after the complete coding is done.It does not exhibit namespace property.C programming has an insufficient level for data abstraction, i.e., does not have very large data handling capacity.C Language does not allow the user to detect the errors with the help of exception handling features.The constructor and destructors concept is not supported by the ... Read More

297 Views
ProblemHow to find the cube root of any given number by using the C programming language?SolutionAlgorithmStep 1: Enter any number at run time Step 2: Read from console Step 3: Compute result Result:pow(number, 1.0/3.0) Step 4: Increment result Step 5: Print resultExampleFollowing is the C program to find the cube root of any given number −//finding cube root of given number// #include #include #include void main(){ int number, result; printf("Enter any number: "); scanf("%d", &number); result=pow(number, 1.0/3.0); result++; printf("\Cube of %d is: %d", number, result); getch(); }OutputWhen the above ... Read More

5K+ Views
An array of characters (or) collection of characters is called a string.Input and output for stringsExampleFollowing is the C program for input and output for strings −#include main ( ){ char a[30]; printf("enter your name"); scanf ( "%s", a); printf ("your name is %s", a); getch ( ); }OutputWhen the above program is executed, it produces the following result −1. Enter your name : Lucky 2. Enter your name : Lucky Lol Your name is Lucky Your name is LuckyNote −‘&’ is not used for accepting strings because name of the string itself specifies the ... Read More

7K+ Views
An array of characters (or) collection of characters is called a string.DeclarationRefer to the declaration given below −char stringname [size];For example - char a[50]; a string of length 50 characters.InitializationThe initialization is as follows −Using single character constant −char string[20] = { ‘H’, ‘i’, ‘l’, ‘l’, ‘s’ ,‘\0’}Using string constants −char string[20] = "Hello":;‘\0’ is called a null character. It marks the end of the string.‘\0’ is automatically placed by the compiler, if a string is given as input. The user has to take care of placing ‘\0’ at the end if a single character is given.Accessing − There is ... Read More

31K+ Views
The End of the File (EOF) indicates the end of input.After we enter the text, if we press CTRL+Z, the text terminates i.e. it indicates the file reached end nothing to read.AlgorithmRefer to the algorithm given below for EOF.Step 1: Open file in write mode. Step 2: Until character reaches end of the file, write each character in filepointer. Step 3: Close file. Step 4: Again open file in read mode. Step 5: Reading the character from file until fp equals to EOF. Step 5: Print character on console. Step 6: Close file.ExampleFollowing is the C program for End of ... Read More

7K+ Views
An array is a group of related data items that share a common name. A particular value in an array is identified by using its "index number" or "subscript".The advantage of an array is as follows −The ability to use a single name to represent a collection of items and to refer to an item by specifying the item number enables the user to develop concise and efficient programs.The syntax for declaring array is as follows −datatype array_name [size];For example, float height [50]This declares ‘height’ to be an array containing 50 float elements.int group[10]This declares the ‘group’ as an array ... Read More

10K+ Views
A temporary storage area is called buffer. All input output (I/O) devices contain I/O buffer.When we try to pass more than the required number of values as input then, the remaining values will automatically hold in the input buffer. This buffer data automatically go to the next input functionality, if it is exists.We have to clear the buffer before the next input is taken in.ExampleFollowing is the C program for buffer −#include void main(){ int a, b; printf(" Enter a value: "); scanf("%d", &a); printf(" Enter b value: "); scanf("%d", &b); printf(" a+b=%d ", ... Read More

591 Views
ProblemCan the user create his/her own custom header files in the C language? If yes, how can we access the user-defined header files?SolutionYes, the user can create his/her own custom header files in C.It helps you to manage the user-defined methods, global variables, and structures in a separate file, which can be used in different modules.Let’s see an example of how to create and access custom header files −ExampleGiven below is the C program to call an external function named swap in the main.c file.#include #include"swaping.h" //included custom header file void main(){ int a=40; int b=60; swaping ... Read More

5K+ Views
A backslash ( \ ) that allows a visual representation of some nongraphic characters introduces an escape.One of the common escape constants is the newline character ( ).Backslash CharactersThe backslash characters are as follows −CharacterMeaning‘\a’alert‘\b’backspace‘\f’form feed‘’newline‘\t’horizontal tab‘\r’carriage return‘\v’vertical tab‘\’backslash‘\’ ’single quote‘\" ’double quote‘\?’Question markExample programFollowing is the C program for the backslash character constants −Example Live Demo#include #define PI 3.14 float area; void main(){ double r; r=1.0; area = PI * r * r; printf("Area is %d ", area); // /n is used to enter the next statement in newline }OutputArea is 1492442840Read More