See a problem in else if statement

Dangling else problem

Image
Hello, This problem comes when we use else if statement and do some mistake more describe is given below......... Dangling else problem: One of the major problem with nested if is dangling else problem. The problem arises when both outer if statement inner if statement might pair with common else statement. Thus the compiler is not able to judge to pair the else with which statement. The solution to this problem is given by the compiler that it pairs else with the recent if thus sometimes giving wrong result.                                           Hence the programmer should put early bracket wherever required. This post is may very short because my only aim was to describe this problem. Thank you, Keep supporting............. 

Introduction to C part 1

                             C programming   

  Structure of the program

There are 6 section in C program -
1. Documentation section 
2. Link 
3. Definition section
4. Global declaration
5. Main section
6. Subprograms

ex. 

#include<stdio.h>
main()
{
printf("Hello C world");
}

#include<stdio.h> :

This is a pre processor command that comes as the first statement in our code. #include statement tells the compiler to include the standard input/output library or header file in the program.

main() :

Every C program contains a main function which is the starting point of the program.

Files used in C program:

Source code Files:

The source code file contains the source code of the program .This file contains C source code that defines the main function and maybe other functions.

Header Files:

when working with large project it is often desirable to separate out certain subroutines from the main function of the program. they're also maybe a place that the same about routine has to be used in different program.

Object Files:

object files are generated by the compiler as a result of processing the source code file.

Tokens in C:


  • Keywords
  • Variables
  • constants
  • strings
  • Special Characters
  • Operators

Character set in C:

special character @,(,),*,&,&,^,! etc. you will learn when you time to time continue your c studies.

Keywords:



There are 32 Keyword available in C language. Keywords are rated in small letters.

Thanks friends
Now this enough for today.If you daily read contents you will complete your C learning.
If you want any point separately explain please comment below i will create new post for that heading or will cover in next post.

Comments

Popular posts from this blog

Libraray Fine Hackerrank solution in C || Balanced Brackets Hackerrank solution in C

Permutations of Strings hackerrank solution in C || Permutations of Strings

Introduction to C part 2