Skip to main content

Posts

Showing posts from November, 2020

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 { }

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, char); // Function declaration int main() {  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 used for th

Translate