Day 2 : Structure of c and Input , Output in c programming


Structure of c and Input , Output in c programming

Read day 1 C language  : Day-1: What are programming and the Basics of c programming.

// Structure of c programming

#include <stdio.h>

void main()





Elements in c programming

# ---> preprocessor directive

include ---> state mant for connection with 

<header_file.h> ---> predifined functions 

<stdio.h>  -> standerd input output     // important for every c program

<conio.h>  -> console input output

Read More Reference:  Introduction to C

// How does c programming work?

     source file-----> compailer--------> interpreter---------> memory------> output shows on terminal

Structure In c lang

1. What are the comments in c Programming?

     a. single-line comment


     b.multiline comment


         Multiline comments


2. Data Types  &  Identifiers

Refer to Our Youtube Channel And Instagram account for More information.

3. What are the keywords in c language?

Keywords are predefined words by the developer of the language for other use cases.

Below I mentioned all keywords in c language.

auto break case char const continue default do

double else enum extern float for goto if

int long register return short signed sizeof static

struct switch typedef union unsigned void volatile while

4. What is white space in c language.

In c lang white spaces are ignored when it compiles in the compiler!

c language is continuous language if you want to add the next line you have to add a specific character in c language. -->  like \n

5. Input & Output Functions

Output is to display the result set/result

  •     printf()
  •     gets()
  •     getchar()
  •     getch()
  •      etc........

Input is to read values from the user

  •    scanf()
  •    puts()
  •    putchar()

Structure of c and Inpu

6 . Difference Btwn Void & Int

   In C, `int` and `void` are different data types with distinct purposes.

1. `int`:

   - `int` is a data type used to represent integers or whole numbers in C.

   - The `int` type typically occupies 4 bytes of memory on most systems, although the size may vary.


2. `void`:

   - `void` is a keyword used as a data type specifier in C.

   - It denotes the absence of a type or the lack of a value.

   - It is often used as a return type in function declarations when the function does not return a value. 


In summary, `int` is a data type used for integers, while `void` is a keyword used to indicate the absence of a type or the lack of a value. `int` is used to declare variables that hold integer values, whereas `void` is used as a return type for functions that do not return a value or as a function parameter to indicate no arguments. 

In the next Session, you will understand about Foramtted outputs in c language.

Post a Comment

Previous Post Next Post