#include<stdio.h>
int main()
{
int i;
for(i=0; i<10; i++)
{
printf("Hello Sok Sabay\n");
}
}
#include<stdio.h>
#include<conio.h>
int main(){
int i;
for(i=0;i<10;i++){
printf("hello \n");
}
return 0;
}
Functions hold code, which means anything that happens within a function can be "called" later on. Allowing the programmer to save time, and ensuring he doesn't have to re-write code. Example: Instead of writing "Hello" 10 times, I made a function that said print("hello") 5 times, then "Called" the function twice. def helloFiveTimes(): print("Hello") print("Hello") print("Hello") print("Hello") print("Hello") return helloFiveTimes() helloFiveTimes()
Without seeing the program, I can only say: 'zero or more times'
Duhh.. printf("hello "); printf("hello "); printf("hello "); printf("hello "); printf("hello "); printf("hello "); printf("hello "); printf("hello "); printf("hello "); Just kidding. Just loop the printing. int x = 0; for(x = 0; x<11; x++) { printf("hello "); } and if you want each "hello" to be in a new line, use this: printf("hello\n");
C++ Hello World Example:// this is a single line comment /* this is a multi-line comment */ #include // header file needed to print using namespace std; // instead of having to write std::cout // the main function is where the program begins execution int main() { // print Hello world. and a new line cout
==== '----------------------------------------------- '*** PROGRAM: Main Menu ' LANGUAGE: QBASIC: VERSION: QB64 '----------------------------------------------- '------------------------------------------ '*** Global variable declarations list... '------------------------------------------ userKeyPress$="" '----------------------- '*** Main Program... '----------------------- DO 'this is a menu driven program... GOSUB clearScreen GOSUB printMainMenuTitleHeading GOSUB printMainMenuOptionsList GOSUB printMainMenuInstructionsHeading GOSUB printMainMenuUserInstructions GOSUB awaitUserKeyPress GOSUB checkUserKeyPress LOOP UNTIL UCASE$(userKeyPress$) = "Q" '...UCASE converts lower case to upper END '...END of program/halt program code execution '---------------------- '*** Sub-routines... '---------------------- clearScreen: CLS '...(CL)ear the output (S)creen RETURN printMainMenuTitleHeading: PRINT "MAIN MENU" PRINT "========" RETURN printMainMenuOptionsList: PRINT "Hit key: <1> for Program 1: 12 X Tables Square" PRINT "Hit key: <2> for Program 2: Select a times tables to print out" PRINT PRINT "Hit key: <Q> to Quit!" PRINT RETURN printMainMenuInstructionsHeading: PRINT "USER INSTRUCTIONS" PRINT "==============" RETURN printMainMenuUserInstructions: PRINT "In order to select from the above Main Menu options list..." PRINT PRINT "First, chose the type of program you wish to run..." PRINT "by, carefully, reading it's description." PRINT PRINT "Then, hit a corresponding single number/letter key, either: '1'/'2';" PRINT "or, alternatively, hit key: 'Q' to Quit!" PRINT PRINT "-Thank you!" RETURN awaitUserKeyPress: DO '...keep looping until when user presses any key... userKeyPress$ = INKEY$ '...store any IN-coming KEY press LOOP UNTIL userKeyPress$ <> "" RETURN checkUserKeyPress: IF userKeyPress$ = "1" THEN GOSUB program1 '...GO to named SUB-routine IF userKeyPress$ = "2" THEN GOSUB program2 '...GO to named SUB-routine RETURN program1: GOSUB clearScreen PRINT "PROGRAM 1" '(...program 1/code goes here...) GOSUB awaitUserKeyPress RETURN program2: GOSUB clearScreen PRINT "PROGRAM 2" '(...program 2/code goes here...) GOSUB awaitUserKeyPress RETURN
Functions hold code, which means anything that happens within a function can be "called" later on. Allowing the programmer to save time, and ensuring he doesn't have to re-write code. Example: Instead of writing "Hello" 10 times, I made a function that said print("hello") 5 times, then "Called" the function twice. def helloFiveTimes(): print("Hello") print("Hello") print("Hello") print("Hello") print("Hello") return helloFiveTimes() helloFiveTimes()
Without seeing the program, I can only say: 'zero or more times'
Duhh.. printf("hello "); printf("hello "); printf("hello "); printf("hello "); printf("hello "); printf("hello "); printf("hello "); printf("hello "); printf("hello "); Just kidding. Just loop the printing. int x = 0; for(x = 0; x<11; x++) { printf("hello "); } and if you want each "hello" to be in a new line, use this: printf("hello\n");
C++ Hello World Example:// this is a single line comment /* this is a multi-line comment */ #include // header file needed to print using namespace std; // instead of having to write std::cout // the main function is where the program begins execution int main() { // print Hello world. and a new line cout
24 times 21= in algorithm standard
For loop is utilize to do any specific work for specific number of times For example to print hello on computer screen 10 time we use For (start = 1; end = 10; start++) count<<"hello"; next
3 times!
==== '----------------------------------------------- '*** PROGRAM: Main Menu ' LANGUAGE: QBASIC: VERSION: QB64 '----------------------------------------------- '------------------------------------------ '*** Global variable declarations list... '------------------------------------------ userKeyPress$="" '----------------------- '*** Main Program... '----------------------- DO 'this is a menu driven program... GOSUB clearScreen GOSUB printMainMenuTitleHeading GOSUB printMainMenuOptionsList GOSUB printMainMenuInstructionsHeading GOSUB printMainMenuUserInstructions GOSUB awaitUserKeyPress GOSUB checkUserKeyPress LOOP UNTIL UCASE$(userKeyPress$) = "Q" '...UCASE converts lower case to upper END '...END of program/halt program code execution '---------------------- '*** Sub-routines... '---------------------- clearScreen: CLS '...(CL)ear the output (S)creen RETURN printMainMenuTitleHeading: PRINT "MAIN MENU" PRINT "========" RETURN printMainMenuOptionsList: PRINT "Hit key: <1> for Program 1: 12 X Tables Square" PRINT "Hit key: <2> for Program 2: Select a times tables to print out" PRINT PRINT "Hit key: <Q> to Quit!" PRINT RETURN printMainMenuInstructionsHeading: PRINT "USER INSTRUCTIONS" PRINT "==============" RETURN printMainMenuUserInstructions: PRINT "In order to select from the above Main Menu options list..." PRINT PRINT "First, chose the type of program you wish to run..." PRINT "by, carefully, reading it's description." PRINT PRINT "Then, hit a corresponding single number/letter key, either: '1'/'2';" PRINT "or, alternatively, hit key: 'Q' to Quit!" PRINT PRINT "-Thank you!" RETURN awaitUserKeyPress: DO '...keep looping until when user presses any key... userKeyPress$ = INKEY$ '...store any IN-coming KEY press LOOP UNTIL userKeyPress$ <> "" RETURN checkUserKeyPress: IF userKeyPress$ = "1" THEN GOSUB program1 '...GO to named SUB-routine IF userKeyPress$ = "2" THEN GOSUB program2 '...GO to named SUB-routine RETURN program1: GOSUB clearScreen PRINT "PROGRAM 1" '(...program 1/code goes here...) GOSUB awaitUserKeyPress RETURN program2: GOSUB clearScreen PRINT "PROGRAM 2" '(...program 2/code goes here...) GOSUB awaitUserKeyPress RETURN
Pocahontas Times Print Shop was created in 1900.
If you need to print some coupons and are wondering just how many you are allowed to print, I have discovered that the average amount of times to print one particular coupon is twice.
this is what the program says :i want to write a C program which reads in one value, the seed for the random number generator. Your program should then generate 100,000 simulated rolls of a pair of dice. The program should calculate and print the number of times the simulated roll of the dice was a 2, the number of times it was a 7 and the number of times it was a 12. Finally, print out the average (three decimal places) of all of the simulated rolls.Your program must have at least one user defined function called die which creates the roll of one die. This function should return an integer value between 1 and 6 inclusive. It should have no arguments.1- i cant figure out how to calculate how many time does the 2 , 7 , 12 print out .2- how to calculate the number in the 100,000 to be able to calculate the avg.3- i dunno how to create the function in the second part .
program is set of instructions or codes that system can only understand and compile where as algorithm is step by step process that system understands easily and user can also understand easily.