0% found this document useful (0 votes)
80 views1 page

"Hello, World": (Printf ) (P P Malloc P Malloc Free (P) )

This C program allocates dynamic memory using malloc twice, first for 5 bytes and then for 7 bytes, and frees the memory with free before ending. It prints "hello, world" and returns 0 to indicate successful execution.

Uploaded by

nalluri_08
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
80 views1 page

"Hello, World": (Printf ) (P P Malloc P Malloc Free (P) )

This C program allocates dynamic memory using malloc twice, first for 5 bytes and then for 7 bytes, and frees the memory with free before ending. It prints "hello, world" and returns 0 to indicate successful execution.

Uploaded by

nalluri_08
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

int main() {

printf("hello, world");
return 0;
}
1 int main(void) {
2 char *p;
3 p=(char *)malloc(5);
4 /* do stuff */
5 p=(char *)malloc(7);
6 free(p);
7 return 0;
8 }

You might also like