Consider the following C program. #include<stdio.h> #include<string.h> void…

PYQ GATE 2017

Consider the following C program.

#include<stdio.h> #include<string.h> void printlength(char *s, char *t) { unsigned int c=0; int len = ((strlen(s) - strlen(t)) > c) ? strlen(s) : strlen(t); printf("%d\n", len); } void main() { char *x = "abc"; char *y = "defgh"; printlength(x,y); }

Recall that strlen is defined in string.ℎ as returning a value of type size_t, which is an unsigned int. The output of the program is __________ .

Attempted by 652 students.

Sign up free to check your answer

Sign up free

Explore the full course: Zero To Hero

Loading lesson…