What is the output of the program in Turbo C (in DOS 16-bit OS)?
#include
int main()
{
char *s1;
char far *s2;
char huge *s3;
printf("%d, %d, %d\n", sizeof(s1), sizeof(s2), sizeof(s3));
return 0;
}
Answers
Answered by
0
Input:-
#include<stdio.h>
int main()
{
char *s1;
char far *s2;
char huge *s3;
printf("%d, %d, %d\n", sizeof(s1), sizeof(s2), sizeof(s3));
return 0;
}
Solution:-
char *s1 = 2 bytes.
char far *s2; = 4 bytes.
char huge *s3; = 4 bytes.
Hence,output is 2,4,4.
#include<stdio.h>
int main()
{
char *s1;
char far *s2;
char huge *s3;
printf("%d, %d, %d\n", sizeof(s1), sizeof(s2), sizeof(s3));
return 0;
}
Solution:-
char *s1 = 2 bytes.
char far *s2; = 4 bytes.
char huge *s3; = 4 bytes.
Hence,output is 2,4,4.
Answered by
0
THE INPUT IS
#include
int main()
{
char *s1;
char far *s2;
char huge *s3;
printf("%d, %d, %d\n", sizeof(s1), sizeof(s2), sizeof(s3));
return 0;
}
THE OUTPUT WILL BE:2, 4, 4
Since C is a compiler language, it may give different output in other COMPUTER LANGUAGE . The above program works good in Windows (TurboC)
#include
int main()
{
char *s1;
char far *s2;
char huge *s3;
printf("%d, %d, %d\n", sizeof(s1), sizeof(s2), sizeof(s3));
return 0;
}
THE OUTPUT WILL BE:2, 4, 4
Since C is a compiler language, it may give different output in other COMPUTER LANGUAGE . The above program works good in Windows (TurboC)
Similar questions