Q. If sum of two integer is 14 and if one of them is 8 then find other integer. Ans: Well, this is very simple. Simply, one integer is 8 and sum of two integers is 14. So, we need to subtract the number 8 from their sum of 14 to get the second number. So, the second number is: 14 - 8 = 6 C-Program of this task Code---> #include<stdio.h> int main () { int num1 = 8 , num2 , sum = 14 ; num2 = sum - num1 ; printf ( "The second number is: %d" , num2 ); return 0 ; }
String Functions
Please, include "String" header file, before using these functions.
#include<string.h>
strlen()
Finds length of a string
strlwr()
Converts a string to lowercase
strupr()
Converts a string to uppercase
strcat()
Appends one string at the end of another
strncat()
Appends first n characters of a string at the end of another
strcpy()
Copies a string into another
strncpy()
Copies first n characters of one string into another
strcmp()
Compares two strings
strncmp()
Compares first n characters of two strings
strcmpi()
Compares two strings by ignoring the case
stricmp()
Compares two strings without regard to case (identical to strcmpi)
strnicmp()
Compares first n characters of two strings without regard to case
strdup()
Duplicates a string
strchr()
Finds the first occurrance of a given character in a string
strrchr()
Finds the last occurrance of a given character in a string
strstr()
Finds first occurrance of a given string in another string
strset()
Sets all characters of string to a given character
strnset()
Sets first n characters of a string to a given character
strrev()
Reverses string
**All Data Collected From "Let Us C" by Yashavant Kanetkar**
Download the exact above information as a document file.
Comments
Post a Comment