Home » Programming » Java Programming » Output a string for many times in Java , C programming, JavaScript & Php

2 years ago (Sep 06, 2015) 2,160 views

Output a string for many times in Java , C programming, JavaScript & Php

Category: Java Programming, Programming Tags: , , , , , , by

Here I am providing source code of a prograam.. By using this you can get the out put of a single input string for many times.You can do it by using a single for loop. So let’s Start

 

#Java

package Practice;

public class StringGenarate {

public static void main(String[] args) {
int n=100;
for (int i = 0; i < n; i++) {
System.out.println(“Here you need to give your input”);
}

}

}

 

#C_Programming

#include <stdio.h>
int main(){
int n=100;
int i=0;
for(i=0;i<n;i++){
printf(“Here you need to give your input\n”);
}
return 0;
}

 

#JavaScript

<!DOCTYPE html>
<html>
<body>

<p>It will excute the text for 100 times</p>

<p id=”demo”></p>

<script>
var text = “”;
var i;
for (i = 0; i < 100; i++) {
text += “Here you need to give your input <br>”;
}
document.getElementById(“demo”).innerHTML = text;

</script>

</body>
</html>

 

#Php

<?php
$n=0;
$txt=”Here you need to give your input<br/>”;
for($n=0;$n<100;$n++){
echo $txt;

}
?>

 

NB:Change the value of variable “n” 100 to how much output you want!

Output:

Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input
Here you need to give your input

About Post: 134

Love to play with programs!! :D

31 Responses to “Output a string for many times in Java , C programming, JavaScript & Php”

  1. zeimen says:

    … [Trackback]

    […] Find More Informations here: trickbd.co/output-a-string-for-many-times-in-java-c-programming-javascript-php/6932 […]

  2. … [Trackback]

    […] Read More: trickbd.co/output-a-string-for-many-times-in-java-c-programming-javascript-php/6932 […]

  3. … [Trackback]

    […] Informations on that Topic: trickbd.co/output-a-string-for-many-times-in-java-c-programming-javascript-php/6932 […]

  4. … [Trackback]

    […] Read More here: trickbd.co/output-a-string-for-many-times-in-java-c-programming-javascript-php/6932 […]

  5. … [Trackback]

    […] Read More Infos here: trickbd.co/output-a-string-for-many-times-in-java-c-programming-javascript-php/6932 […]

  6. ppc says:

    … [Trackback]

    […] Find More Informations here: trickbd.co/output-a-string-for-many-times-in-java-c-programming-javascript-php/6932 […]

  7. … [Trackback]

    […] Find More Informations here: trickbd.co/output-a-string-for-many-times-in-java-c-programming-javascript-php/6932 […]

  8. … [Trackback]

    […] Read More here: trickbd.co/output-a-string-for-many-times-in-java-c-programming-javascript-php/6932 […]

  9. … [Trackback]

    […] Find More Informations here: trickbd.co/output-a-string-for-many-times-in-java-c-programming-javascript-php/6932 […]

  10. Great News

    This story was very interesting. Thank you.

  11. Payday Loans might be useful

    I just want to say that payday loans might help in some dire financial situations.

Leave a Reply

You must be logged in to post a comment.