Interviews Questions, Algorithms, Aptitude, C Interview Program, C Theory Question, Aptitude Tricks, Test Series,

Monday 10 June 2019

Tricky Interview#6

Question:

WAC PROGRAM THAT GIVES THE SIZE OF STRING WITHOUT USING ANY FUNCTION(PRE DEFINED OR USER DEFINED), NO LOOPS AND NO RECURSION.

Solution:

#include<stdio.h>
void main()
{
int a[100],n;
printf("Enter the String\n");
scanf("%s",a);
n=printf("%s\n",a);
printf("%d",n-1);
}

0 comments:

Post a Comment