Posts

Showing posts from February, 2020

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

What is Array in C|| Array

Hello friends today we are going to start new topic of c language name is ARRAY Today, in this post i will tell describe you that what is array and where we use this? So now start this topic and friends please ask your doubts in comment if you have any kind of problem. Array: Array is a collection of similer type of  elements stored in continuous memory allocation. Mean we can store only same type value in array after declare that. If we declare that or integer we can only store integer number in it,if we declare for float we can store any float number. But we know float can store any integer value but int can't store any float value so after declare for int we will store only integer value. If we store any digit in array it store continuously in memory so we can easily find address of any array element. When we declare any variable it store any where in memory but when we use array for declare many variable it allocate continuously in memory. Type of array: The

Different Types of Codes

Hello guys, you are learning C language Here you many times hear name ASCII code and other codes now today in my this post you will learn about all codes. firstly i tell you that i will tell about 4 codes..................... BCD Code:  ( Binary coded decimal ) Here each digit of decimal no. is represented by it binary equivalent.Four bit code that represents one of the ten decimal digits from 0 to 9. Ex. (37)base 10 is represented as 0011 0111 using BCD code, rather than (100101) base 2 in straight binary code.Thus BCD code requires more bits than straight binary code.Still it is suitable for input and input operations in digital systems. EBCDIC: (Extended binary coded decimal for interchange code) In this code it is possible to represented 256 different characters.It is an eight bit code.8-bit alphanumeric code developed by IBM, supports 256 symbols.It was mainly used in IBM mainframe computers.                                 EBCDIC is a character encoding set us

Storage Class Part 2

This is a second part of storage class............................. Extern: Keyword used is extern. Identifiers declares in global scope by default has extern storage class. If the extern variable is declared in local scope then it cannot be initialized with declaration but if it is declared with global scope than it can be initialized with declaration. The extern storage class specifiers is used to  specify that an object is defined with external linkage. Extern variable can not be used in parameter. Ex. #include<stdio.h> int a=20; main() { print("Value of a:%d",a); } Output: Value of a:20 Typedef: typedef is used for syntactic convenience. Used for creating a synonyms or alias for a known type. Does not introduce a new type. Syntax: typedef datatype   variable name   new name; Ex. #include<stdio.h> main() { typedef int pi; pi x=5,y=10; printf("x=%d\n",x); printf("y=%d\n",y); retur