Skip to main content

Posts

Showing posts with the label Computer science

Functions in C-Computer Science-Important topic in C

 Function in C ->Watch this for FUN -  Funny job interview Are you getting bored with online lectures? ->Watch this -  When online lectures are boring   Function in C is a very important topic in C. The library in C has many in-built functions like printf, scanf, etc. Every C program has at least one main function where the code starts executing.  The main function is declared using int main(). Now, we'll be going to see various types of function declaration, their return types, etc. There are three main things for executing a function in C programming language which are its declaration , its calling , and its execution . The return type of function includes primitive and derived data types. For data types, refer to  this. Function declaration :          There are two ways where you can declare/call a function. Way 1 : Declaring outside the main, globally, int(return type) fun(data type of arguments); For example, void fun(int...

Data types in C-Computer Science-Important topics

 Data Types in C ->Watch this for FUN -  Funny job interview Are you getting bored with online lectures? ->Watch this -  When online lectures are boring   Data types are the building blocks of any programming language. It is the most important topic in C, without data types there couldn't be any foundation of C programming language. So, now let's move on to the types of Data types in C. <><><><><><><> There are three types of data types in C: 1) Primitive data types. 2) Derived data types. 3) User-defined data types. So, let's explore what each one is about: 1) Primitive Data Types Primitive data types in C programming language includes  int, char, float, void . The int data type is used for the declaration of integer variables like: int x=10; // integer x takes value 10 The char data type is used for the declaration of character variables like: char x='a'; // character x takes value a The char data type is us...

Vectors in C++-Important topics in C++-Computer science

  Vectors in C++ ->Watch this for FUN -  Funny job interview Are you getting bored with online lectures? ->Watch this -  When online lectures are boring   Vectors in C++ are a sequence container class that implements the dynamic size of the array to store things without caring for its size. ****** Array vs Vectors An array although is a static allocation where size is fixed, but in Vectors, the size is not fixed due to its dynamic nature.  ***** Declaration of Vectors std:: vector<int> vec; //under #include<vector> library ***** Important functions of vectors are: emplace() ->vec.emplace(position,value) inserts the value at the specified position. emplace_back() ->vec.emplace_back(value) inserts the value at the end of the vector. insert() ->vec.insert(position,value) inserts the value at the front of the position given in the function. resize() ->vec.resize(value), resizes the vector's size to the value. reserve() ->vec.reserve(...

What are Macros in C? Macros/preprocessor directives-Important topic in C programming language-computer science/Information technology

M acros are preprocessor directives in C, a very important topic in C, are used at the top of the C program. It is nothing but a constant value that you have to declare at the starting of the program. ->Watch this for FUN -  Funny job interview Are you getting bored with online lectures? ->Watch this -  When online lectures are boring   For example, #define P 11.20 Here if you use P in any part of the program then it is nothing but 11.20. It should be define on the top, #include<stdio.h> #define P 11.20 int main() {     //code } There are some major pre-defined macros which you can use in the program. _ _ DATE _ _ For the current date. _ _ TIME _ _ For the current time.  _ _ FILE _ _ For getting the current file name. _ _ LINE _ _ For getting the current line number. And even you can define the function in macros as, #define ADD(a,b) a+b where just use ADD(a,b), it will return a+b in the value.  Are you getting bored with online lectures? W...

Beginning with Computer science??-computer science/Information technology

Are you a beginner in Computer Science? ->Watch this for FUN -  Funny job interview Are you getting bored with online lectures? ->Watch this -  When online lectures are boring   No worries!! Computer Science-Is it a NO or a YES? What do you think? let’s find out! Computer science is the study of computation and information. Computer science has impacted a lot in our daily lives, whether we have to design software or to book something online for shopping. Computer Science Computer science is the medium of all the online services that are evolving throughout the world. So, now you wanna ask me what is computer science build of? Computer science is not just about the front-end that you see in your daily lives but it is built on tonnes and tonnes of codes which run and execute in the back-end part which is not seen-able. Those parts of the code consist of languages generally called programming languages (generally because HTML, CSS are not programming languages). N...

Translate