Tumgik
mylearningmania · 14 days
Text
Relation Between Array and Pointer in C
Before knowing the relationship between an array and a pointer, we should know what an array and pointer is.
Let's understand the basic concept of array and pointer first then we will learn how to implement an array with the help of a pointer in C program.
Array is a derived data type. Array is a collection of homogeneous types of data. We can say that an array is a kind of variable that can hold more than one value at the same time.
Generally, a simple variable can hold a single value at a time but the array can hold many. It depends upon the size of the array.
In order to hold many values, an array is allotted with many blocks having index numbers to access them. These index numbers always start with 0 and end with (the size of the array-1).
Each array needs to be declared first before being used in a program.
In declaration, a subscript is associated with the name of the array containing an integer number.
This integer number determines the size of the array and array is always followed by the for loop.
Syntax of Array:
dataTypes NameofArray[SizeofArray]; 
For Example:
int rollno[15]; 
Here, int is data type and rollno is a variable of an array type (name of an array) and 15 is the size of the array (means rollno can hold 15 integer value under rollno container).
The index of rollno array starts with 0 and ends with 14. Remember that index is starting with 0, it means that rollno[0] will indicate the first value stored in rollno and rollno[14] will indicate the last value stored inside rollno.
We can access any index value by writing its index number in the big bracket.
Suppose, we want to access the value stored at 13 index of rollno. We can access it by writing
rollno[13].
Example: Array in C
#include 
#include 
 
void main() { 
int a, arrayB[8]; 
clrscr(); 
 
printf("Enter 8 values: \n"); 
 
for(a=0; a<8; a++) { 
scanf("%d", &arrayB[a]); 
 
printf("Printing the array: \n"); 
 
for(a=0; a<8; a++) { 
printf("%d ", arrayB[a]); 
 
getch(); 
Output:
Enter 8 values: 
10 
-5 
100 
58 
23 
-90 
51 
Printing the array: 
10 -5 2 100 58 23 -90 51 
Explanation:
10 is stored at arrayB[0] 
-5 is stored at arrayB[1] 
2 is stored at arrayB[2] 
100 is stored at arrayB[3] 
58 is stored at arrayB[4] 
23 is stored at arrayB[5] 
-90 is stored at arrayB[6] 
51 is stored at arrayB[7] 
Types of Array
Array is of two types. They are as follows
Single Dimension Array
Multi Dimension Array
Read Full Article → Array and Pointer in C
0 notes
mylearningmania · 14 days
Text
Programming in C++ Basics
C++ is a general-purpose programming language which is used for developing Games, GUI based applications, Image editing Applications, Web browser, Compiler, OS, etc. It also supports Object-Oriented Programming.
Here, we will understand and write our first program in C++. We will write the program which prints ‘Hello World’ as output. So, it is also called the ‘Hello World’ program in C++. Let’s see it
Example: Hello World program in c++
#include<iostream>
using namespace std;
int main() {
cout << “Hello World..!”
return 0;
}
Output
Hello World..!
#include<iostream>:
This statement tells the compiler to include this header file named iostream so that we can use the predefined input-output functions in the program.
using namespace std:
This is used to identify whether cin or cout is user built function or standard identifiers. here, std represents standard identifiers (cout and cin).
If you do not include using namespace std in a program and make use of cin and cout then it will throw an error. However, this error can be solved either by making use of using namespace std in the program or by using std::cout<< and std::cin>> in the program.
Generally we add single using namespace std in the program rather than writing all cout and cin statements like std::cout and std::cin in the program. It makes it easier for us to program.
int main():
This is the main function of our program. The program execution begins with this function. Here, int is the return type that means it return some integer value at last and that is the reason behind writing return 0 at last in the program.
cout<<”Hello World..!”:
The cout work is to display whatever is written between double quotes. It is the standard identifier belonging to the iostream file. This can also display the value of any variables written with it. We will see it later.
return 0:
This means that the execution of the main function is now successful.
Read Full Article → Programming in C++
0 notes
mylearningmania · 16 days
Text
What are OOPs in C++?
C++ fully supports object-oriented programming including the six pillars of object-oriented development. They are:
1. Class and Object
2. Encapsulation
3. Data Hiding
4. Inheritance
5. Polymorphism
6. Message Passing
Class and Object in C++
1. The concepts of objects and classes are linked with each other and form the foundation of the object-oriented paradigm.
2. An object is described as an instance of the class.
3. An object is a real-world component in object-oriented circumstances that may have a physical or conceptual presence.
4. Objects can be modeled according to the need of the application. An object can be a customer, a car, etc or an intangible conceptual existence like a project, a process, etc.
Read Full Article → OOPs in C++
0 notes
mylearningmania · 16 days
Text
Control Statements in C
All those statements that decide whether the upcoming statements are executed or not are called control statements. They are also known as decision-making statements.
Generally, a C program is executed in the flow directive from top to bottom and left to right. In this flow, all the statements written in the program are executed one after another in the sequence they are written.
But many times, the programmers want that some statements remain unexecuted on the basis of certain conditions. The programmer wants to execute the statements iff some condition becomes true otherwise not. This can be done in the program by using control statements or decision-making statements.
What are different types of statements used in C?
The following are the different types of control statements that are used in the C programming language.
1. If statements (if, if ... else, nested if, ladder if)
2. Conditional statements
3. Switch statements
4. Goto statements
5. For loop
6. While loop
7. Do loop
8. Break statement
9. Continue statement
Read Full Article → Control Statements in C
0 notes
mylearningmania · 16 days
Text
Data Types in C with Examples
Basically, data types are those which are used for the variables in C programs. It defines which type of data the variables are going to be stored.
In the declaration of every variable, it is mandatory to specify its data type. The declaration of variable includes data type and identifier.
Data types may be classified into four types. The following is the classification of datatypes in C language. The first one is primitive data types (Basic or fundamental), the second one is user-defined datatypes, the third one is derived data types and the last one is an Empty set.
Fundamental or Basic data types
User-defined data types
Derived data types
Empty set
Read Full Article → Data Types in C
0 notes
mylearningmania · 18 days
Text
C Programming Operators
Operators are the symbol used to perform some operations. In C, they are defined in two ways.
On the basis of operands they required.
On the basis of the type of operation they perform.
Operators On the basis of operands required:
Unary operators
Binary operators
Ternary operators
Unary Operators in C
They requires one operand to complete its operation.
for example
++ increment
-- decrement
+ unary plus
- unary minus
! not
Here, let me tell you that what is mean by unary plus and minus. Consider a statement -4, +5, the sign that is used before a number as a prefix only, then it is called unary plus or minus.
Let say -5-7: Here, the minus sign before 5 is called unary minus but the minus sign in between 5 and 7 is called subtraction.
Read Full Article → C Programming Operators
0 notes
mylearningmania · 18 days
Text
Introduction to C Programming
Here, you will come to know about the Introduction to C Programming Language. You will learn various concepts of C language like how the compiler works, what is a program, and how we can let the machine to perform some tasks that are written in C Language. Let us learn from the beginning.
Computer programming helps the computer to understand what to do next and how to do it. Programming gives the command to the computer system to do various tasks.
In programming, we give a set of instructions (programs) to the machine in the languages which are understood by the machine for performing various tasks like adding two numbers, dividing two numbers, and so on.
C is a middle-level programming language which is used for general-purpose programming. C language was invented to write UNIX Operating system. It had been reading in assembly language.
Read Full Article → Introduction to C Programming
0 notes
mylearningmania · 18 days
Text
Introduction To C Language
Language is a mode of communication through which two systems communicate with each other. For instance, Human beings communicate with each other in the language they know like Hindi, English, French, Spanish, etc.
A language barrier occurs when both the system know different languages. Suppose the person whom you talking does not understand your language then it will become difficult for both of you to understand the conversation.
In this case, we take the help of a translator. Somewhat all the computer languages work the same way that translates the source code into machine code. The process of this translation is known as compilation or interpretation.
C is a middle-level programming language which is used for general-purpose programming. C language was developed by Dennis Ritchie at Bell Laboratory in 1972.
The ANSI (American National Standards Institute) had formalized the C programming language in 1988. C programming language had been written in assembly language.
C programming language was invented to write UNIX Operating system. LINUX OS, PHP, and MySQL are written in C programming language.
Read Full Article → Introduction to C
0 notes
mylearningmania · 20 days
Text
Introduction to C++ Programming Language
C++ is a language that supports object-oriented programming paradigm. C++ emphasis on data rather than procedure. You can easily learn the C++ programming language by understanding C and some advanced features of the OOP concept. C++ programs are divided into objects and classes.
1. It is a general-purpose language used in Games, GUI based applications, image editing applications, web browsers, compilers, OS, etc.
2. It is a middle-level language.
3. It is a compiled language which makes it efficient and fast.
Read Full Article → C++ Programming
0 notes
mylearningmania · 20 days
Text
What makes the Dark Web Dangerous?
Hey, I know that you have heard about the Dark Web in the past and that is why you came here to know more about the Dark web. So, Let's learn something more about the Dark web in detail.
You will also come to know about the things that make Dark web so dangerous that it feels afraid of thinking about the dark web.
So, Why the dark web is not available just like the surface web? What are the things that make the dark web so dangerous that we feel afraid to dive into the dark web? Let's start with knowing what is dark web first.
Dark web is the most dangerous part of the internet. Dark web is a subset of Deep Web. It is that part of the internet world that is not indexed in any of the search engines like Google, Bing, etc.
The dark web is that part of the worldwide web which is neither available on the search engine nor mostly people have the key to access it. The key to enter the dark web is only known to that person are on the dark web and who surfs the dark web.
You know if you want to access and surf on the dark web then you will need a secret key. This key will help you to go inside the dark web.
Several illegal things are happening here on the dark web. It is not illegal to access the dark web but it is not also legal to surf the dark web. It is so because one will accidentally go to the undesired things after clicking on the link. It is the part of Deep Web.
Read Full Article → Deep Web Dangerous Web
0 notes
mylearningmania · 20 days
Text
What is Deep Web and Dark Web ?
Some pages of the website are indexed on Google and any other search engine while others are not. The pages of websites that are indexed on Google and any other search engine are said to be on the Surface web.
The pages of websites which are not indexed on Google and any other search engine is said to be on the deep web and even on the dark web.
The pages of the Dark Web are also not available in search engines. Deep Web is a place where Google cannot find anything.
The deep web is that part of the internet that is hidden and is not indexed on any of the search engines. For example, I made a website and there is one page created by me on the website such that I don't want that everybody reads it.
The dark web is a subset of the Deep web and it is that part of the internet world which is also not indexed in any of the search engines like Google, Yahoo, Bing, etc.
On that page, there is a secret information that I want to share with only one person or a group of limited persons and not for others then I will put it on the deep web.
That one person or group of limited persons who wanted to access the page can access the page if and only if when they have the URL, username, and password of that page. This is what we call the deep web.
We can only access the page on the deep web if we have the required URL, username, and password of the desired page.
Read Full Article → Deep Web & Dark Web
0 notes
mylearningmania · 22 days
Text
What are Computer Programs?
How to Design Computer Programs? Designing a computer program is an important part of any program. Actually, it consists of a strategy that is going to be used to solve any problems with the help of the program.
Program design is the process with the help of which the programmer can write or create a program. It is a problem-solving activity. Remember one thing, All the programs transform input into output.
First, you take initial requirements that means you have to understand the problem in a better way that you are going to solve with the help of the program by designing it.
Then you have to gather the data related to the problem and analyze it deeply and think
How do you implement those data into coding to solve the problem?
The code that does the conversion of inputs of the program is called the logic of the program. The logic then acts on the data which is called the model.
Your program must convert the input of the program into a model and then the model into some output.
The 1–2–3 is a high-level program design patterns in Computer Science. This is the easiest programming pattern that you have learned on the very first day of programming earlier.
In 1–2–3 programming patterns, the programs ask the user to give some input and do something then finally print it as an output on the screen. For example “Hello World” program is a 1–2–3 pattern program.
REPL (Read Execute Print Loop) programming pattern is another programming pattern. Here, the programs go back after printing the output on the screen and again ask the user for input.
Read Full Article -> Computer Program
0 notes
mylearningmania · 22 days
Text
High Level Programming Language
A language that uses English words or mathematical symbols in the place of the mnemonic code is called high-level programming language or simply high-level language. It is a user-friendly programming language.
It is machine-independent. Each and every instruction written by the programmer in a high-level language is get translated into many machine language instructions by using a translator software.
This translator software is either a compiler or an interpreter. Both the translator works in different ways. An interpreter converts the high-level language code, one line at a time (line by line conversion). When the line is converted into a machine code, it is then executed at the same time.
If any error occurs while converting the code, the interpreter stops translating and notify the errors to the user.
The compiler translates the source code in its own way. It translates the code’s line one after another (all at once conversion) but does not execute at the same time of translations.
Once the translation is done and the source code is converted into object code then the program can be run independent of the translator software and development environment.
If there is an error in the source code then the compiler tells the user about the error and the user has to recompile the code after correcting the error.
In Assembly language, one-to-one translation occurs i.e, the instructions written by the programmer in assembly language are converted into machine language by the assembler.
Read Full Article -> High Level Language
0 notes
mylearningmania · 23 days
Text
Introduction to Assembly Language
Assembly language is a computer programming language (a language that is used to make computer programs). It was introduced by David John Wheeler.
It is a low-level programming language (closer to machine). Machine can understand assembly language in a better way than that of a high-level language.
The language which enables instructions to be described by letters rather than numbers is called assembly language. It is also called as Symbolic Language.
The program which is written in this language is known as an assembly language program or symbolic program. This programming language uses Mnemonics in place of 0’s and 1’s (binary code) to represent opcode.
This language uses symbolic addressing capabilities due to which it simplifies the programming process because the programmer does not need to remember the exact location of data.
The programmer can express an address number to symbolic data by using symbolic addressing.
Read More -> Assembly Language
1 note · View note
mylearningmania · 23 days
Text
Opcode and Operand
Opcode is the first part of an instruction that tells the computer what function to perform and is also called Operation codes. Opcodes are the numeric codes that hold the instructions given to the computer system.
These are the instructions that describe the CPU what operations are to be performed. The computer system has an operation code or opcode for each and every function given to it.
Operand is another second part of instruction, which indicates the computer system where to find the data or instructions or where to store the data or instructions.
The number of operands varies amongst different computer systems. Each instruction indicates the Control Unit of the computer system what to perform and how to perform it.
The operations are Arithmetic, Logical, Branch operation, so on depending upon the problem that is provided to the computer.
Read More -> Opcode and Operand
0 notes
mylearningmania · 23 days
Text
What is Remote Sensing and GIS?
GIS stands for Geographic Information System. According to Tomlin GIS may be defined as a configuration of both software as well as hardware which are specially designed for the use and maintenance of cartographic data.
GIS is described as an information system that is used to take input, store, retrieve, manipulate, analyze it and finally generate output geographically referenced data or geospatial data, in order to maintain and support decision making toward planning and management of different things like land use, natural resources, environment, transportation, urban facilities, and other administrative records.
Remote Sensing is made from two words namely “remote” which means “something which is far away” and “sensing” which means “gathering information or getting data”.
Remote sensing is the science of gathering information about the Earth’s land and water areas with the help of images captured by using sensing devices.
The remote sensing devices do not come in contact with the Earth. It is operated from a remote location. It is a technology of acquiring information about earth surface without actually being in contact with it.
Do you wanna read more about it click here -> GIS and Remote Sensing
0 notes
mylearningmania · 24 days
Text
What is Machine Language?
Machine language is a low-level language consists of binary digits. The machine language consists of strings of binary numbers (0's and 1's), and this is only the language understood by the computer system.
Every high-level language code must be converted into machine language either by a compiler or by an interpreter so as to execute and run the code on the computer. It is so because the hardware can only understand the binary code.
Sometimes, it is also mentioned as a machine code or object code. Machine code is the fundamental or basic language of a computer. The computer can only understand binary language (i.e., 0 and 1).
The particular binary code is used for some instructions to be executed in machine language. The opcode (also called operation code) of each and every computer system is different depending upon its microprocessors which are called machine code.
The machine codes are the fundamental language of the computer which are written in binary language. The computer socket inside the computer system can immediately recognize the machine language and converts it into electrical signals that are used further.
An instruction developed in any machine language has a two-part composition namely Opcode and Operand.
Read Full Article here -> Machine Language
1 note · View note