Skip to content
Early access — you're among the first to try PYQLabs. Share feedback
Concept drill

strings

GATE CSE & IT · C Programming - Pointers and Strings · 1989-2025

12
PYQs
75%
keyed
0
elite explanations
10
years appeared

Study anchor

Source-book anchor pending for this concept.

Practice action

Start latest PYQ

PYQs in this concept

All concepts →
2025 Q30

Let S be the set of all ternary strings defined over the alphabet {a, b, c}. Consider all strings in S that contain at least one occurrence of two consecutive symbols, that is, "aa...

hardanswer key
2025 PYQ

Let $S$ be the set of all ternary strings defined over the alphabet $\{a, b, c\}$. Consider all strings in $S$ that contain at least one occurrence of two consecutive symbols, that...

easybasic explanation
2024 PYQ

Consider the following C function definition. int fX(char *a) { char *b = a; while(*b) b++; return b - a; } Which of the following statements is/are TRUE?

easyanswer keybasic explanation
2017 Q55

Consider the following C Program. #include #include int main() { char* c = "GATECSIT2017"; char* p = c; printf("%d", (int)strlen(c+2[p]-6[p]-1)); return 0; } The output of the prog...

hardanswer key
2015 PYQ

Consider the following function written in the C programming language. void foo(char *a){ if ( *a && *a != ' '){ foo(a+1); putchar(*a); } } The output of the above function on inpu...

easyanswer key
2015 PYQ

Consider the following C program segment. #include < stdio.h > int main() { char s1[7] = "1234", *p; p = s1 + 2; *p = ‘0’; printf("%s", s1); } What will be printed by the program?

easyanswer key
2014 PYQ

Consider two strings A = “qpqrr” and B = “pqprqrp”. Let x be the length of the longest common subsequence (not necessarily contiguous) between A and B and let y be the number of su...

medium
2004 PYQ

Consider the following C program segment: char p[20]; char *s = "string"; int length = strlen(s); for(i=0; i < length; i++) p[i] = s[length-i]; printf("%s",p); The output of the pr...

easyanswer key
2003 PYQ

Consider the set $$\sum {^ * } $$ of all strings over the alphabet $$\,\sum { = \,\,\,\left\{ {0,\,\,\,1} \right\}.\sum {^ * } } $$ with the concatenation operator for strings

easyanswer key
1998 PYQ

How many substrings of different lengths (non-zero) can be formed from a character string of length $$n$$ ?

easyanswer keybasic explanation
1994 PYQ

The number of sub-strings (of all lengths inclusive) that can be formed from a character string of length $$n$$ is

easyanswer key
1989 PYQ

How many substrings (of all lengths inclusive ) can be formed from a character string of length $$n$$? Assume all characters to be distinct. Prove your answer.

easy