Answers for "how to concat numbers in c"

C
1

how to add two numbers in c

#include <stdio.h>
int main() {    
	int sum_tot = 0;
    int num_1, num_2;    
    printf("Please, Enter First integer: ");
    scanf("%d", &num_1);
    printf("\nNow Please, Enter Second integer: ");
    scanf("%d", &num_2);

    sum_tot = num_1 + num_2;      
    
    printf("\n%d + %d = %d", num_1, num_2, sum_tot);
    return 0;
}
Posted by: Guest on July-24-2021
4

concatenate two strings in c

#include <stdio.h>
#include <string.h>
int main()
{
  char a[1000], b[1000];

  printf("Enter the first string\n");
  gets(a);

  printf("Enter the second string\n");
  gets(b);

  strcat(a, b);

  printf("String obtained on concatenation: %s\n", a);

  return 0;
}
Posted by: Guest on May-10-2020

Code answers related to "C"

Browse Popular Code Answers by Language