• edited by
695 views
0 0 votes
#include<string.h>
#include<stdio.h>
int main()
{
    char str[13]="C at lakshya";
    char str1[]="secret";
    strcat(str,str1);
    printf("%d %d",sizeof(str),strlen(str));
}

Output :- $13$ $18$

Here although sizeof str is $13$ then also it is concatenating why ?

1 Answer

Position:
Show:

Related questions

6 6 votes
4 4 answers
2.1k
2.1k views
GO Classes asked May 2, 2022
2,110 views
What will be output printed by the following program?#include<stdio.h main() { int c=4; switch(c) { c=c-1; case 4: printf("IITB ")...
7 7 votes
2 2 answers
1.2k
1.2k views
GO Classes asked May 2, 2022
1,230 views
Trace the execution of the following if statements and select the output from this code fragmentint main() { int a = 3, b = 7 ; if ( (a + b) % 2 != 0 ) { printf("tetrahed...