Skip to main content

Posts

What is the general form of a C program in C programming?-Computer Science-Important topic in C

General form  ->Watch this for FUN -  Funny job interview Are you getting bored with online lectures? ->Watch this -  When online lectures are boring   Generally, the C program starts with the header files , followed by preprocessor directives (like macros), and then followed by the functions or the variables to be declared globally which is again followed by the main function for starting the execution. #include<stdio.h> // Header files #define a 10 // Preprocessor directives int x=10; // Global variable int main() // main function { }
Recent posts

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...

Structures in C programming language-Important topics in C-computer science/Information technology

S tructures in C programming language ->Watch this for FUN -  Funny job interview Are you getting bored with online lectures? ->Watch this -  When online lectures are boring   Structures in C is a very important topic in the C programming language as it can store multiple data types due to which it comes under the user-defined data type.  By the multiple data types, I mean that it can store data types like int, float, char, double, etc. The declaration of a structure in C goes like : struct name{ // name is Name of the structure int n,m; //int data type float f;  //float data type char a[20000];  //character data type }; NOTE :- You cannot initialize any data type in structures , like struct name{ int n=3,m=2; // ERROR float f=3.5; //ERROR }; By using structures, it would become very easy to store multiple information of any kind. For using structures in the int main in C, let's take the example of storing the ID, NAME of the student, the program goes...

Call by value and call by reference in C-Important topics in C-computer science/Information technology

Call by value and Call by Reference  in C ->Watch this for FUN -  Funny job interview Are you getting bored with online lectures? ->Watch this -  When online lectures are boring   There are two ways to call out a function in C and those are Call by Value and Call by Reference. So, what they are, let's find out. <><><><><><><> Call by value :                                 Here the values in the function get copies of the original values but they don't get a revert to the modified value.  For example:                      void swap(int x, int y)                      {                             int temp=x;              ...

How to make your header file in C?-Important topics in C-computer science/Information technology

Making your header file ->Watch this for FUN -  Funny job interview Are you getting bored with online lectures? ->Watch this -  When online lectures are boring   Yes, you can make your header file, as we use the standard header files which are stored in your system, the same way we can also make our. So, let's see how? Step 1 . Define the functions which you will gonna use in the program in some file named (hello.h). Step 2 . In the program file, use #include"hello.h" for including that header file which has been saved by you. <><><><><><><> That's it, you are done, now you can use the functions which you have declared in the hello.h file anywhere in the program. Watch this for FUN -  Funny job interview Are you getting bored with online lectures? Watch this -  When online lectures are boring <><><><><><><> I hope you  have  learned something today. Visit other po...

Standard header files in C programming language-Important topics in C-computer science/Information technology

Standard header files in C programming language ->Watch this for FUN -  Funny job interview Are you getting bored with online lectures? ->Watch this -  When online lectures are boring   Header files are the files that contain the set of predefined library functions that can be used anywhere while writing the program. That's why they become handy in use for their operations while writing a C program. Even you can make your header file. The following header files are the standard ones: 1. stdio.h                This header file is used for various input/output functions like printf() , scanf() ,etc. <><><><><><><> 2. stdlib.h                This header file is mainly used for dynamic memory allocation like malloc() , calloc() , realloc() , free() and even for some functions like abs() [for absolute value of the number] and atoi() [ for converting...

What is 5g?Its technology and working-computer science/Information technology

5th Generation ->Watch this for FUN -  Funny job interview Are you getting bored with online lectures? ->Watch this -  When online lectures are boring   What is 5G?                     It is the technology that is the 5th generation standard for cellular networks. With the increasing demands and connectivity between people, 5th generation technology is a game-changer for them. It would lead to serving a million devices per square kilometer while the existing one 4G serves 100,000 devices per square kilometer. So you can now estimate its impact on people's lives. With GLOBAL data traffic doubling every 18 months, high-speed 5G connectivity comes into play. This technology would reduce human digital tasks in a second. <><><><><><><> <><><><><><><> Working of 5G:                     ...

Basic GIT commands line tutorial-for beginners and for developers with examples-computer science/Information technology

GIT Commands tutorial ->Watch this for FUN -  Funny job interview Are you getting bored with online lectures? ->Watch this -  When online lectures are boring   Hello Everyone and welcome back to learn one of the most wanted skills in today's world i.e. GIT. Now we'll gonna start with the basic git commands tutorial. So, let's get started. <><><><><><><><><> First of all, what is git? Git is a free and open-source distributed version control system designed to handle everything from small to very large projects. Its command-line provides various operations to perform the various tasks of any project. Almost every online project in this world is built with the help of git and its command line. By learning git you can expose yourself to the current and fastest-growing market skills. It is the skill that every developer should have, to sustain and...

Translate