- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- 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 34494 Articles for Programming
636 Views
In this section we will see how to create a birthday reminder application using Python. Problem Statement Create an application using Python, which can check whether there is any birthday on the current day or not. If it is the birthday of some listed person, send a notification to the System with the name of that person. We need a file, where we can store the date and month and the name of the person as a lookup file for this application. The file will look like this − Here we will convert this application to a start-up application ... Read More
1K+ Views
Here we will see how we can get the UNIX shell style pattern matching techniques using Python. There is a module called fnmatch, which is used to do the work. This module is used to compare file name against a pattern, then returns True or False according to the matches.To use it at first we need to import it the fnmatch standard library module.import fnmatchIn the Unix terminal, there are some wildcards to match the patterns. These are like below −‘*’ The asterisk is used to match everything.‘?’ Question Mark is for matching a single character.[seq] Sequences are used to ... Read More
7K+ Views
Variable sized arrays are data structures whose length is determined at runtime rather than compile time. These arrays are useful in simplifying numerical algorithm programming. The C99 is a C programming standard that allows variable sized arrays.A program that demonstrates variable sized arrays in C is given as follows −Example Live Demo#include int main(){ int n; printf("Enter the size of the array: "); scanf("%d", &n); int arr[n]; for(int i=0; i
328 Views
Array is a collection of same type of elements at contiguous memory location. The lowest address corresponds to the first element while highest corresponds to last element. Array index starts with zero(0) and ends with the size of array minus one(array size - 1). Array size must be integer greater than zero.Let us see an example, If array size = 10 First index of array = 0 Last index of array = array size - 1 = 10-1 = 9Multi-dimensional arrays are arrays of array. The data is stored in tabular form in row major order.The following is the syntax ... Read More
1K+ Views
The following is an example to print variable name.Example Live Demo#include #define VariableName(name) #name int main() { int name; char ch; printf("The variable name : %s", VariableName(name)); printf("The variable name : %s", VariableName(ch)); return 0; }OutputThe variable name : name The variable name : chIn the above program, the variable names are printed by defining the method before main()#define VariableName(name) #nameTwo variables of different datatypes are declared. By using the defined function, variable names are printed.int name; char ch; printf("The variable name : %s", VariableName(name)); printf("The variable name : %s", VariableName(ch));
1K+ Views
The power function is used to find the power given two numbers that are the base and exponent. The result is the base raised to the power of the exponent.An example that demonstrates this is as follows −Base = 2 Exponent = 5 2^5 = 32 Hence, 2 raised to the power 5 is 32.A program that demonstrates the power function in C++ is given as follows −Example Live Demo#include using namespace std; int main(){ int x, y, ans = 1; cout > x; cout > y; for(int i=0; i
270 Views
When static keyword is used, variable or data members or functions can not be modified again. It is allocated for the lifetime of program. Static functions can be called directly by using class name.Static variables are initialized only once. Compiler persist the variable till the end of the program. Static variable can be defined inside or outside the function. They are local to the block. The default value of static variable is zero. The static variables are alive till the execution of the program.The following is the syntax of static keyword.static datatype variable_name = value; // Static variable static ... Read More
810 Views
The following is an example to compute combinations using factorials.Example Live Demo#include using namespace std; int fact(int n) { if (n == 0 || n == 1) return 1; else return n * fact(n - 1); } int main() { int n, r, result; coutn; coutr; result = fact(n) / (fact(r) * fact(n-r)); cout