Planning to start your technical career by learning the programming language but getting confused about where to start? There are huge numbers of programming language among which you can choose from. Modern technology is running beside .NET, C, C#, Azure and more. But if you are starting your learning ten you can start with C, C#, C++. However before choosing any of those languages, you have to know the differences between all these.
What is C?
It is the oldest and most widely used programming language among C languages. Previously Unix operating system was using C language which is the lowest level of programming readable language by a computer. The creation of C transformed the programming and operating system forever. However, C is still a low-level programming language that provides base level admittance to memory and it needs very little run-time support.
It has been published 40 years ago but still it is the most popular yet widely used programming language of all time. Developers are still using this in operating system, hardware driver, kernel level software and applications as well which are require to work with older version of code. The people are using it in smaller that make it a less desirable target for hackers.
What is C#?
C# or C Sharp is a high level object oriented programming language that has been build as an extension of C. It was developed by the team of Microsoft which is based in the .NET framework but the backbone I still C language. It was developed by the team of Microsoft which is based in the .NET framework but the backbone I still C language.
Rather than machine code, C# is compiles into byte code which means it can executes on a virtual computer that can translates it into machine code on the fly. It adds garbage collection, bound checking, uninitialized variable checking as well as type checking capabilities to the base C code.
C# is mainly using internal or enterprise applications rather than commercial software. C# is generally found in client and server development in the .NET framework. C# is generally found in client and server development in the .NET framework.
Though C# is technically complicated language but its syntax is less error-prone than C, C++ and can be learned relatively quickly.
C vs C#:
Though C and C# is technically related to each other but they are totally different languages. Thus, there are lots of differences between them rather than any similarities. Having knowledge and background in C will definitely help you to learn C# because of the similarities in syntaxes but C# syntax is so forgiving that you can easily learn it without even having any knowledge in C language. Having knowledge and background in C will definitely help you to learn C# because of the similarities in syntaxes but C# syntax is so forgiving that you can easily learn it without even having any knowledge in C language.
if statement in c:
The syntax of if statement in C programming is something like below:
If (test expression)
{
//code
}
Working process of if statement:
The If statement in C , appraises the test expression inside the parenthesis ().
Now, if the test expression is executed to true, statements inside the body of (if) will then executed. Now, if the test expression is executed to true, statements inside the body of (if) will then executed.
But if the test expression executed as false, statements inside the body of (if) will not executed.
This if statement can also have an else block as an optional one. Then syntax will be then like:
if (test expression) {
//run code if test expression is true
}
else {
//run code if test expression is false
}
Now, if the test expression will executed as true:
Then the statements inside the body of (if) are execute, and statements inside the body of (else) will skip its execution. But, if the test expression is execute as false:
The statements inside the body of (else) will be then execute and the statements inside the body of (if) will skip from execution.
Read Also: – Ten Tips to Help Students Manage Stress
OOPs Concepts in C#:
OOPs or Object Oriented Programming model is a concept of modern programming language which allows the programmer to organize entities and objects. The main four key concepts of OOPS are, encapsulation, abstraction, ploymorphism and inheritance.
OOPs concept in C# is a encoding model of programming where programs are prearrange around objects and data rather than logic and action. A class is the main part or core section of any modern Object Oriented Programming language such as C# and in any OOPs language, it is mandatory to create a class to represent the data.
A class is the main part or core section of any modern Object Oriented Programming language such as C# and in any OOPs language, it is mandatory to create a class to represent the data. So, A class is a blue print of an object which encloses variables for accumulating data and functions to carry out operations on the data. A class is a blue print of an object which encloses variables for accumulating data and functions to carry out operations on the data. As the class does not occupy any memory storage space, so it is only the logical representation of data.
Boxing and Unboxing in C#:
Boxing is the way of changing the value type to the object type or any other interface type applied by this value type. When the CLR or Common Language Runtime boxes a value type, it covers the value inside a system. Object instance and then stores it in the managed heap. Now, Unboxed will then extract the value type from the object. Object instance and then stores it in the managed heap. Now, Unboxed will then extract the value type from the object. Boxing is unspoken and unboxing is open. Boxing is unspoken and unboxing is open. So the Boxing and Unboxing in C# is a concept which is a combined view of the type system in which a value of any type can be indulgence as an object.