Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

what does this program do?

+1 vote
asked Nov 3, 2022 by khouloud (130 points)

int main()
{
    int a = 68, b = 80;
    char *ch;
    ch = (char*)malloc(10);
    sprintf(ch,"%d + %d",a,b);
    printf("%s",ch);
  
    return 0;
}

2 Answers

0 votes
answered Nov 4, 2022 by Peter Minarik (86,130 points)
Why not copy and paste it into the OnlienGDB compiler and see the result for yourself?

Anyway, the output is "68 + 80" (without the quotes of course).
0 votes
answered Nov 4, 2022 by Ravikanthonline (140 points)

dynamically allocate a single large block of memory

o/p: 68 + 80

Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...