The problem is probably due to the size of the char array s1 not being large enough to contain the concatenated strings.
The ampersand has no special meaning inside a string, its just like any other character. Try out the following code:
#include <stdio.h>
#include <string.h>
int main() {...
You should use the Random class within the java.util package. The method nextInt() can be used to generate a new random number as shown in the following code :
import java.util.Random;
class RandomNumbers {
public static void main(String [] args) {
int generatedNumber, i...
You should use the Random class within the java.util package. The method nextInt() can be used to generate a new random number as shown in the following code :
import java.util.Random;
class RandomNumbers {
public static void main(String [] args) {
int generatedNumber, i...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.