RISHI EXP1 - i++) { temp[i]=a[i] } for(j=0 b[j] j++) {...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 Enter two strings:rishi /* RISHI AGARWAL Roll no 02 SE CMPN A */ #include<stdio.h> #include<conio.h> void main() { int x,i,j,flag=0 char a[30],b[30],temp[60] clrscr() printf("Enter two strings:") printf("\nTo compare the strings press 1\n") printf("To concatenate the strings press 2\n") switch(x) { case 1:{ for(i=0 a[i]||b[i] i++) { flag=0 if(a[i]!=b[i]) { flag=1 break } } if(flag==0) {printf("\nEQUAL") } else if(flag==1) {printf("\nNOT EQUAL") } break } case 2: {
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Sheet1 Page 2 for(i=0 a[i]
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: i++) { temp[i]=a[i] } for(j=0 b[j] j++) { temp[i+j]=b[j] } temp[i+j]='\0' printf(&quot;The concatenated string is %s&quot;,temp) break } default:{ printf(&quot;THe choice entered is invalid&quot;) } } getch() } OUTPUT: Enter two strings:rishi rishi To compare the strings press 1 To concatenate the strings press 2 1 EQUAL Enter two strings:rishi agarwal To compare the strings press 1 To concatenate the strings press 2 2 The concatenated string is rishiagarwal...
View Full Document

Page1 / 2

RISHI EXP1 - i++) { temp[i]=a[i] } for(j=0 b[j] j++) {...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online