APJ ABDUL KALAM TECHNOLOGICAL UNIVERSITY Previous Years Question Paper & Answer

Course : B.Tech

Semester : S1 and S2

Year : 2017

Term : DECEMBER

Branch : BIOTECHNOLOGY

Scheme : 2015 Full Time

Course Code : CS 100

Page:18





PDF Text (Beta):

case 4:
printf("divof%d&%dis%d",a,b,a/b);

break;

case 5:
printf("modularof%d&%dis%d",a,b,a/b);

break;

default:

printf ("\n invalid option");

getch();

}
2 a) List any five string handling functions with examples

1. strepy(s1, 52);
٠ 0೦0165 string 52 into string 51.

C String function - strcpy char *strepy(
char *stri, char *str2)

It copies the string str2 into string 511, including the end character (terminator char ‘\0’).

Example of strepy:

#include
#include
int
main() {
char s1[30] = "string 1";
char s2[30] = "string 2 : I’m gonna copied into 51";
/* this function has copied s2 into s1*/
55೫೦0೦೫ (51, 52) ;
printf ("String 51 is: %s",
51); return 0;

Output:

String sl is: string 2: I’m gonna copied into 51

2. strcat(s1, s2);
٠ Concatenates string 52 onto the end of string 51.

C String function - strcat
char *strceat(char + 8111, char *str2)

Similar Question Papers