1.)
Multiplying a number by 7 without using * and + operators.
NewNum = NewNum - Num; // 8 – 1 = 7
2.)
Finding the last character of any String.
(OR)
Write a function that finds the last instance of a character in a string
char *lastChar(char *String, char ch)
{
char *cStr = NULL;
// traverse the entire string
while(*String ++ != NULL )
{
if(*String==ch)
cStr = String;
}
return cStr;
}
No comments:
Post a Comment