write a program for size of a data type without using
sizeof() operator?

Answer Posted / lalit kumar

#include "stdafx.h"
#include "stdio.h"
#include "conio.h"
int main()
{
char *a,*s, v='m';
a=&v;
s=a;
a++;
int intsize=(int)a-(int)s;
printf("%d",intsize);
getch();
return 0;
}

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

A routine usually part of the operation system that loads a program into memory prior to execution a) linker b) loader c) preprocessor d) compiler

627


Declare the structure which contains the following members and write in C list of all students who score more than 75 marks. Roll No, Name, Father Name, Age, City, Marks.

686


Write a program to print "hello world" without using a semicolon?

598


Do pointers store the address of value or the actual value of a variable?

612


What does 4d mean in c?

950






How can I do serial ("comm") port I/O?

691


Differentiate between a structure and a union.

769


Where in memory are my variables stored?

638


c programs are converted into machine language with the help of a) an interpreter b) a compiler c) an operatinf system d) none of the above

738


What are categories used for in c?

569


What is the explanation for modular programming?

688


Why malloc is faster than calloc?

593


What is the use of getchar() function?

631


What is the use of bitwise operator?

693


using only #include and #include Write a program in C that will read an input from the user and print it back to the user if it is a palindrome. The string ends when it encounters a whitespace. The input string is at most 30 characters. Assume the string has no spaces and distinguish between and lowercase. So madam is a palindrome, but MadAm is not a palindrome. Use scanf and %s to read the string. Sample Test: Enter a string: madam madam is a palindrome. Enter a string: 09023 09023 is not a palindrome.

1315