C Programming - Declarations and Initializations - Discussion

Discussion Forum : Declarations and Initializations - True / False Questions (Q.No. 4)
4.
Size of short integer and long integer can be verified using the sizeof() operator.
True
False
Answer: Option
Explanation:

True, we can find the size of short integer and long integer using the sizeof() operator.
Example:


#include<stdio.h>
int main()
{
    short int i = 10;
    long int j = 10;
    printf("short int is %d bytes.,\nlong int is %d bytes.",
            sizeof(i),sizeof(j));
    return 0;
}

Output:
short int is 2 bytes.
long int is 4 bytes.

Discussion:
8 comments Page 1 of 1.

Prajakta said:   5 years ago
Short int is 2 bytes.
int is 4 bytes.
long int is 8 bytes.

Prajakta said:   5 years ago
Short int is 2 bytes.
int is 4 bytes.
long int is 8 bytes.

Prajakta said:   5 years ago
Short int is 2 bytes.
int is 4 bytes.
long int is 8 bytes.

Prakhar said:   6 years ago
Short int is 2 bytes.
int is 4 bytes.
long int is 8 bytes.

Prakash varshan said:   9 years ago
Here, int main () it returned the main function again and again.

Vishesh sharma said:   9 years ago
Is sizeof(i), size(j) predefined in library? I mean are they inbuilt function?

Pavi indhu said:   9 years ago
If we use int main() it is necessary to use return 0.

It is used to return the main function again and again.

Deai said:   1 decade ago
What is the function of return 0? please anyone explain?

Post your comments here:

Your comments will be displayed after verification.