Write a simple program to find the size of different basic
data types in C.
Answers were Sorted based on User's Feedback
Answer / rajiv
int x,y,b;
char a;
x=sizeof(y);
b=sizeof(a);
printf("the size of int is %d & the size of char is
%d",x,b);
| Is This Answer Correct ? | 20 Yes | 4 No |
Answer / jugad
#include
#include
int main()
{
printf(ā%d %d %d %dā,sizeof(int),sizeof(unsigned
int),sizeof(float),sizeof(char));
getch();
return 0;
}
courtesy:http://answerwale.co.cc/?p=23
| Is This Answer Correct ? | 21 Yes | 7 No |
Answer / gajendra patil
#include <stdio.h>
#include <conio.h>
int main(){
int *a;
printf("\nSIZE OF DIFFERENT DATA TYPES\n");
printf("\n------------------------------");
printf("\n\tBASIC");
printf("\n------------------------------");
printf("\nCHARACTER \t: %d byte(s)",sizeof(char));
printf("\nSHORT \t\t: %d byte(s)",sizeof(short));
printf("\nINTEGER \t: %d byte(s)",sizeof(int));
printf("\nLONG \t\t: %d byte(s)",sizeof(long));
printf("\nFLOAT \t\t: %d byte(s)",sizeof(float));
printf("\nDOUBLE \t\t: %d byte(s)",sizeof(double));
printf("\nLONG DOUBLE \t: %d byte(s)",sizeof(long double));
printf("\nLONG LONG \t: %d byte(s)",sizeof(long long));
printf("\nPOINTER (any) \t: %d byte(s)",sizeof(*a));
printf("\nARRAY \t\t: sizeOfDataType * sizeOfArray [eg. int a[10]=%d byte(s)]",sizeof(int)*10);
printf("\n------------------------------");
return 0;
}
| Is This Answer Correct ? | 5 Yes | 2 No |
what is the coding of display the factorial of a number using array and function?
What are pointers? What are stacks and queues?
write a C program, given number is double without using addt ion and multiplication operator?ex:n=6,ans=12,pls send me ans to goviseenu@gmail.com
What is typedef?
what will be printed by this printf? printf("%c",printf("hi")["sharkselva"])); }
Table of Sudoku n*n
Write a program to implement queue.
i have to apply for rbi before that i need to know the the syllabus for the entrance questions. whethet it may be aps or techinical
Explain why can’t constant values be used to define an array’s initial size?
Write code for atoi(x) where x is hexadecimal string.
Write a program to write a given string in maximum possibilities? i.e str[5]="reddy"; i.e we can write this string in 120 ways for that write a program
write an algorithm to display a square matrix.