- Home
- Course Category
- Course Result
- Course Detail
Hot Line: 0124-2383121
Course Introduction
Programs for practice
In the program below, we've introduced beginers to programming in C++. Comparing two integer variables is one of the simplest program you can write at ease. In this program, you can either take input from user using scanf()
function or statically define in the program itself
Source Code:Concatenate strings
/* C++ Program - Concatenate strings */ #include <stdio.h> #include <string.h> int main() { char s1[10] = "Taj"; char s2[] = "Mahal"; int i, j, n1, n2; n1 = strlen(s1); n2 = strlen(s2); j = 0; for(i = n1; i< n1+n2; i++ ) { s1[i] = s2[j]; j++; } s1[i] = '\0'; printf("%s", s1); return 0; }Output
TajMahal