Computer Sciences > Gate 2017 Set-1 > String
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("%dn", len);
}

void main()
{
    char *x = "abc";
    char *y = "defgh";
    printlength(x, y);
}


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

Explanation

Correct : 3

Similar Questions

What is the worst-case time complexity of insertion in an AVL tree?
Question #23 Medium
Which operations on a binary search tree have O(h) complexity?
Question #31 Easy
Compare search complexities of sorted array vs balanced BST.
Question #47 Hard

Related Topics

Data Structures Binary Search Tree Time Complexity Algorithm Analysis Tree Algorithms Computer Science