
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 26504 Articles for Server Side Programming

796 Views
ProblemWrite a C program to calculate a balance installment that is to be paid after every month for a particular loan amount (with interest).SolutionFollowing is the formula to calculate interest when the loan amount is given −i=loanamt * ((interest/100)/12);Following calculation gives amount with interest −i=i+loanamt; firstmon=i-monthlypayment; //first month payment with interest i=firstmon * ((interest/100)/12);Program Live Demo#include int main(){ float loanamt, interest, monthlypayment; float i, firstmon, secondmon; printf("enter the loan amount:"); scanf("%f", &loanamt); printf("interest rate:"); scanf("%f", &interest); printf("monthly payment:"); scanf("%f", &monthlypayment); //interest calculation// i=loanamt * ((interest/100)/12); //amount with interest i=i+loanamt; ... Read More

3K+ Views
ProblemWrite a C Program to enter the amount in dollars and then display the amount by adding 18% as tax.SolutionLet’s consider the restaurant person adding 18% tax to every bill of the customer.The logic applied to calculate tax is −value=(money + (money * 0.18));The money should be multiplied by 18% and add to the money, then the restaurant person can receive the amount from a customer with tax.Example Live Demo#include int main(){ float money, value; printf("enter the money with dollar symbol:"); scanf("%f", &money); value=(money + (money * 0.18)); printf("amount after adding tax= %f", value); return ... Read More

7K+ Views
The volume of sphere is nothing but the capacity of the shape.Volume of a sphere formula is −$$V\:=\:\frac{4}{3}\Pi\:r^{3}$$AlgorithmStep 1: Enter radius of sphere at runtime Step 2: Apply the formula to variable Volume=(4/3)*3.14*rad*rad*rad Step 3: print the volume Step 4: stopProgram 1 Live Demo#include int main(){ float vol; int rad; rad=20; vol=((4.0f/3.0f) * (3.1415) * rad * rad * rad); printf("the volume of a sphere is %f", vol); return 0; }Outputthe volume of a sphere is 33509.335938Program 2Following is an example to find Volume and Surface Area of Sphere − Live Demo#include ... Read More

6K+ Views
The sscanf() Function The sscanf() function from the C library reads input from a string and stores the results in specified variables. Each argument must be a pointer to a variable that matches the specified type in the format string. Syntax sscanf(string, formatspecifier, &var1, &var2, ……..) Parameters The following are the parameters for the sscanf() function − The String refers to the character string to read from. The Format string refers to a character string containing the required formatting information. Var1, var2, etc., represent the individual input data items. For example, this code extracts two integers from the ... Read More

942 Views
ProblemExplain the concept of reference and pointer in a c programming language using examples.ReferenceIt is the alternate name for the variable that we declared.It can be accessed by using pass by value.It cannot hold the null values.Syntaxdatatype *variablenameFor example, int *a; //a contains the address of int type variable.PointerIt stores the address of variable.We can hold the null values using pointer.It can be access by using pass by reference.No need of initialization while declaring the variable.Syntaxpointer variable= & another variable;Example Live Demo#include int main(){ int a=2, b=4; int *p; printf("add of a=%d", &a); printf("add of b=%d", &b); ... Read More

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

298 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