Read OnLine C- Program Example

09_STRING
PRAC 5 PRAC 6
//strupr(),strlwr() function in c
//it convert string to uppercase
//it convert string to lowercase #include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
char s[]="Imacc Education";
clrscr();
printf("\n Source String=%s",strupr(s));
printf("\n Source String=%s",strlwr(s));
getch();
}
------output-------
Source String=IMACC EDUCATION
Source String=imacc education
//strncat() function in c
// It append a portion of string to another string
#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{ char s1[]="Imacc";
char s2[]="Education";
clrscr();
strncat(s1,s2,1);
printf("\n Source String=%s",s1);
getch();
}
-----output-------
Source String=ImaccE

Previous Next
Download Download