
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 33676 Articles for Programming

8K+ Views
Enter a string at run time and read a character to replace at console. Then, finally read a new character that has to be placed in place of an old character where ever it occurs inside the string.Program1Following is the C program to replace all occurrence of a character − Live Demo#include #include int main(){ char string[100], ch1, ch2; int i; printf("enter a string : "); gets(string); printf("enter a character to search : "); scanf("%c", &ch1); getchar(); printf("enter a char to replace in place of old : "); scanf("%c", &ch2); for(i = 0; i

909 Views
In this post, we will understand the difference between ‘ref’ and ‘out’ in C#.Ref keywordBefore passing the parameters to ‘ref’, they need to be initialized.It is not necessary to initialize the value of the parameter before it returns to the calling method.The data can pass in two directions when the ‘ref’ keyword is used.It is useful when the called method needs to change the value of the parameter that is passed.Out keywordIt is not required to initialize parameters before it is passed to ‘out’.It is required to initialize the value of a parameter before it is returned to the calling ... Read More

3K+ Views
The user has to enter a number, then divide the given number into individual digits, and finally, find the product of those individual digits using for loop.The logic to find the product of given digits is as follows −for(product = 1; num > 0; num = num / 10){ rem = num % 10; product = product * rem; }Example1Following is the C program to find the product of digits of a given number by using for loop − Live Demo#include int main(){ int num, rem, product; printf("enter the number : "); scanf("%d", & num); ... Read More

2K+ Views
In this post, we will understand the difference between delegates and events in C#.DelegateIt can be declared using the ‘delegate’ keyword.It is a function pointer.It holds the reference to one or more methods during runtime.It is an independent keyword.It doesn’t depend on events.It contains the Combine() and Remove() methods that help add methods to the list of invocation.It can be passed as a parameter to a method.The ‘=’ operator can be used to assign a single method.The ‘+=’ operator can be used to assign multiple methods to a delegate.EventIt can be declared using the ‘event’ keyword.It can be defined as ... Read More

5K+ Views
In this post, we will understand the difference between packages and interfaces in Java.PackagesIt is a group of classes and/or interfaces that are together.It can be created using the "Package" keyword.It can be imported.It can be done using the "import" keyword.Examplepackage package_name; public class class_name { . (body of class) . }InterfacesIt is a group of abstract methods and constants.It can be created using the "Interface" keyword.It can be extended by another interface.It can also be implemented by a class.It can be implemented using the ‘implement’ keyword.Exampleinterface interface_name { variable declaration; ... Read More

6K+ Views
Swap two arrays without using a temporary variable. We will use arithmetic and bitwise Operators instead of a third variable. The logic to read the first array is as follows − printf("enter first array ele:"); for(i = 0; i < size; i++){ scanf("%d", &first[i]); } The logic to read the second array is as follows − printf("enter first array ele:"); for(i = 0; i < size; i++){ scanf("%d", &first[i]); } The logic to swap the two arrays without using a third variable is as follows − for(i = 0; i < size; i++){ ... Read More

16K+ Views
Palindrome number is a number which remains same when it reverses. In C language, the user is allowed to enter any positive integer and to check, whether the given number is palindrome number or not by using the while loop.Example1Following is the C Program to find Palindrome number by using the while loop − Live Demo#include int main(){ int num, temp, rem, rev = 0; printf("enter a number:"); scanf("%d", &num); temp = num; while ( temp > 0){ rem = temp %10; rev = rev *10+ rem; ... Read More

6K+ Views
Here, the user has to enter the length in centimeters (cm), and then, convert the length into meters (m), and kilometer (km).1 Meter = 100 Centimeters 1 Kilometer = 100000 CentimetersAlgorithmRefer an algorithm given below to convert centimeter into meter and kilometer respectively.Step 1: Declare variables. Step 2: Enter length in cm at runtime. Step 3: Compute meter by using the formula given below. meter = centim / 100.0; Step 4: Compute kilometer by using the formula given below. kilometer = centim / 100000.0 Step 5: Print meter. Step 6: Print kilometeExample1Following is the C program to convert ... Read More

1K+ Views
In this post, we will understand the difference between float and double data types.floatIt has a single precision.It takes 4 bytes of memory.According to IEEE, it has 32-bit precision.It is used with graphic based libraries.It improves the processing power of programs.It is simple to manage by compilers.Its value can be between 1.2E-38 to 3.4E+38.It can have a precision of up to 6 decimal places.doubleIt has a double precision.It takes 8 bytes of memory.According to IEEE, it has 64-bit precision.Its value can be between 2.3E-308 to 1.7E+308.It can have a precision of up to 15 decimal places.It is considered as the ... Read More

7K+ Views
In programming, int and long are the part of primitive data type. The int stores the integer value while long stores the larger range of values like a whole number. In this article, we will see the differences between int and long data types. int (Integer) Data Type The keyword int representing the integer value. It store the both positive and negative values such as -1, 45, -78, 85, etc., but not fractional and decimal values. The value ranges from –2, 147, 483, 648 to 2, 147, 483, 647. Behavior of int in Different Languages Following is the list of ... Read More