how to generate the length of a string without using len
funtion?
Answer Posted / poornima
#include<stdio.h>
int strlength(char *);
int main()
{
char *str;
int len;
printf("Enter a string : ");
gets(str);
len=strlength(str);
printf("Length of %s is %d",str,len);
return 0;
}
int strlength(char *str)
{
int len=0;
for(;*str!='\0';str++)
{
len++;
}
return len;
}
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
we need to calculating INCOME TAX for the person. The INCOME TAX is as follows:- First $10000/- of income : 4% tax Next $10000/- of income : 8% tax Next $10000/- of income : 11.5% tax above $10, 00,00/- : 15% tax What is the Solution of this Question ?
Can a file other than a .h file be included with #include?
What is difference between array and structure in c?
Explain void pointer?
What is uint8 in c?
Why is C language being considered a middle level language?
What are the advantages and disadvantages of c language?
Explain the binary height balanced tree?
What is the difference between āgā and āgā in C?
please explain clearly about execution of c program in detail,in which stage are the printf sacnf getting into exeecutable code
How can I ensure that integer arithmetic doesnt overflow?
What happens if a header file is included twice?
What is pass by reference in c?
what are the program that using a two dimensional array that list the odd numbers and even numbers separately in a given 10 inputs values
Explain the process of converting a Tree into a Binary Tree.