void main()
{
int *mptr, *cptr;
mptr = (int*)malloc(sizeof(int));
printf(“%d”,*mptr);
int *cptr = (int*)calloc(sizeof(int),1);
printf(“%d”,*cptr);
}
Answer / susie
Answer :
garbage-value 0
Explanation:
The memory space allocated by malloc is uninitialized,
whereas calloc returns the allocated memory space
initialized to zeros.
Is This Answer Correct ? | 2 Yes | 1 No |
# include<stdio.h> aaa() { printf("hi"); } bbb(){ printf("hello"); } ccc(){ printf("bye"); } main() { int (*ptr[3])(); ptr[0]=aaa; ptr[1]=bbb; ptr[2]=ccc; ptr[2](); }
Write a C program that defines a 2-dimentional integer array called A [50][50]. Then the elements of this array should randomly be initialized either to 1 or 0. The program should then print out all the elements in the diagonal (i.e. a[0][0], a[1][1],a[2][2], a[3][3], ……..a[49][49]). Finally, print out how many zeros and ones in the diagonal.
How to read a directory in a C program?
main() { extern i; printf("%d\n",i); { int i=20; printf("%d\n",i); } }
Write a C program to add two numbers before the main function is called.
main() { int a=10,*j; void *k; j=k=&a; j++; k++; printf("\n %u %u ",j,k); }
main() { char not; not=!2; printf("%d",not); }
main() { float i=1.5; switch(i) { case 1: printf("1"); case 2: printf("2"); default : printf("0"); } }
What is the output for the program given below typedef enum errorType{warning, error, exception,}error; main() { error g1; g1=1; printf("%d",g1); }
write a program in c language to get the value of arroy keys pressed and display the message which arrow key is pressed?
What is data _null_? ,Explain with code when u need to use it in data step programming ?
find simple interest & compund interest