How do you write vowels in Qbasic?
cls
input" enter any string";a$
f=Len(A$)
d=1
AA:
b$= mid$(a$,d,1)
d=d+1
c=asc(b$)
if c=101 or c=105 or c=970 or c=111 or c=117 then
cnt= cnt+1
end if
if d<=f then goto aa
print cnt;
end
How would you write a program to display even numbers between 0-20?
ALGORITHM EVEN
BEGIN
FOR ( num = 0; num <= 20; num++ )
BEGIN
IF ( num MOD 2 == 0 ) THEN
DISPLAY (num)
END IF
END FOR
END EVEN
in C:
#include <stdio.h>
int main (void) { puts ("0 2 4 6 8 10 12 14 16 18 20"); return 0; }
A linear queue models the FIFO(first in first out) data structure, much like a line in real life. The first person in line will be the first person served, in queues the first element to be added is the first that can be removed. The only adding point is to the end of the list and the only removal point is the beginning of the list.
Queue<String> q = new LinkedList<String>(); // The LinkedList class implements Queue
q.add("Bob"); // Now Bob is at the front of the queue
q.add("Stacy"); // Stacy after Bob
q.add("Will"); // and Will after her
String removed = q.remove(); // Bob is removed
q.add("Michael"); Michael is added after Will
System.out.println(q); // Prints ["Stacy", "Will", "Michael"]
What are control structures used in javascript?
The control structures used in java script are if-statement, for-loop, for-in loop, while loop,do-while loop, switch-statement, with-statement. try-catch-finally statements.
What is the difference between photo electric effect and compton effect?
In photo electric effect,
In photo voltaic effect,
How do you add 2 numbers in QBASIC?
I'm not too sure that I understand exactly what you mean by 'add a square'...?! Thus, I will attempt to answer the question using multiple different ways; hoping that, least, 'one' of these answers might be right...
==>
CLS
PRINT "PROGRAM: Twelve Times Tables Number Square"
FOR intTimes% = 1 TO 12
FOR intTables% = 1 TO 12
sum% = intTimes% * intTables%
noOfSpaces% = 0
IF LEN(STR$(sum%)) = 2 THEN noOfSpaces% = 2
IF LEN(STR$(sum%)) = 3 THEN noOfSpaces% = 1
PRINT sum%; SPC(noOfSpaces%);
NEXT
NEXT
END
<==
...QBASIC Code/End.
How do you swap two numbers in qbasic?
Create a form with two text boxes (txtNumber1, and txtNumber2) and a command button (cmdSwap).
Option Explicit
Dim numb1 As Variant
Dim numb2 As Variant
Private Sub cmdSwap_Click()
numb1 = txtNumber1.Text
numb2 = txtNumber2.Text
txtNumber2.Text = numb1
txtNumber1.Text = numb2
End Sub
Why qbasic is a higher level languages?
QBasic Benefits :-
1) It is a good language for beginners.
2) It has English-like commands.
3) QBasic has an easy format and is easy to implement.
4) The errors in codes can be fixed easily.
QBasic Limitations:-
1) It is not professional programing language.
2) The language is not structured.
3) It is hard to understand.
4) It is rarely used in real life except in the field of education and training.
How do you display 1 11 111 1111 11111 in qbasic using FOR.NEXT?
cls
a =1
for i = 1 to 5
print a;
a = (a*10)+1
next i
end
What are the words that make up a high-level programming language called?
Some languages have specific terms, however keyword or reserved word is the general terminology we use when referring to a programming language's primary vocabulary. That is; words that cannot be used as identifiers. However, some languages also have contextual keywords. For instance, C++ has final and override contextual keywords. These can be used as both identifiers and keywords, depending on the context. The only reason for this is that people were using these words as identifiers before they were introduced to the language (in C++11) and making them actual keywords would have broken a lot of older code.
How do you print kamal kama kam ka k this pattern in qbasic?
QBASIC CODE/START...
====
...QBASIC CODE/END.
How do i type the a with a circlely thing around it?
@...the AT symbol is located...on my 'own' keyboard, at least, next to the [COLON(:)/SEMI-COLON(;)] key. It's above the [single quote(')/(@)]...that means it's an UPPER CASE symbol.
To obtain UPPER CASE 'letters/symbols/numbers' that are shown on your keyboard...you need to...
1. press, and, hold down the [SHIFT] button key...
-(which is, usually, shown as being an 'upwards arrow'...there are two [SHIFT] button keys, each located on either side of the keyboard, next to/and, on top of both the [CTRL] keys)-
2. ...whilst at the same time, pressing down the [@] symbol key.
====
SOME FURTHER NOTES
ASCII/American Standard Code for Information Interchange, uses the numbers:
-> 65-90, to represent UPPER CASE alphabet letters: A-Z
-> 97-122, to represent 'lower case' alphabet letters: a-z
-etc.
You can have a go at experimenting, try typing in all of the ASCII code numbers: 0-255;
to discover seeing what character comes up, next...?!
NOTE: Some ASCII number codes are, in fact, 'invisible' characters that will NOT display...;
such as ASCII number 32 represents a [SPACEBAR] key invisible 'space' character/
too, there is the invisible [TAB] character key which also won't display/-etc.
How do you find the minimum and the maximum of a function?
'*** PROGRAM: Compare 2 numbers using both min/max functions;
' then, output which number is max/and, which is min.
'*** declare variables...
min = 0
max = 0
number1 = 342
number2 = 256
'*** main program...
CLS '...(CL)ear the Output (S)creen
PRINT "Minimum = "; findMin(number1, number2)
PRINT "Maximum = "; findMax(number1, number2)
END '...END of program/halt program code execution
FUNCTION findMax (num1, num2)
answer = 0
IF num1 > num2 THEN answer = num1 ELSE answer = num2
findMax = answer
END FUNCTION
FUNCTION findMin (num1, num2)
answer = 0
IF num1 < num2 THEN answer = num1 ELSE answer = num2
findMin = answer
END FUNCTION
---program output...
Minimum: 256
Maximum: 342
How do you find the smallest value in a set of numbers in qbasic?
Store the numbers in a suitable container such as an array. Assume the first number is the smallest and assign its value to a local variable. Traverse the remainder of the sequence, comparing each element's value to the stored value. If an element has a lower value, assign its value to the local variable. When the sequence is fully traversed, the local variable will hold the value of the smallest value in the sequence. Return that value.
Sum of two matrices in c program?
#include<stdio.h>
#include<conio.h>
main()
{
int a[4][4],b[4][4],c[4][4],i,j;
printf("enter the elements of matrix a");
for(i=0;i<=3;i++)
for(j=0;j<=3;j++)
scanf("%d",&a[i][j]);
printf("the first matris is");
for(i=0;i<=3;i++)
{
printf("\n");
for(j=0;j<=3;j++)
printf("%d",a[i][j]);
}
printf("Enter the elements of second matrix");
for(i=0;i<=3;i++)
for(j=0;j<=3;j++)
scanf("%d",&b[i][j]);
printf("the second matrix is");
for(i=0;i<=3;i++)
{
printf("\n");
for(j=0;j<=3;j++)
printf("%d",b[i][j]);
}
for(i=0;i<=4;i++)
for(j=0;j<=4;j++)
c[i][j]=a[i][j] + b[i][j];
printf("the addition of matrix is");
for(i=0;i<=3;i++)
{
for(j=0;j<=3;j++)
printf("%d\t",c[i][j]);
printf("\n");
}
getch();
}
What is the program to print Fibonacci series in qbasic?
CLS
a = 0
b = 0
FOR i = 1 TO 10
IF a = 0 THEN
f = 1
END IF
PRINT f
b = a
a = f
f = a + b
NEXT i
END
from : Parth jani
parthjani7@yahoo.com
WAP to print even numbers upto 20 and find the total in Q-Basic?
cls
total=0
for i=0 to 20 step -2
total = total+i
print i ;
next i
print "total is " total
end
send by tripti
How do you get FBide basic to pause for 5 seconds before doing the next command?
You can't. If you want to pause between each command you have to step through the commands one at a time, or set a breakpoint at the point you wish to start stepping through.
Process is passive entity is it true?
No, Process is an active entity. Program, on the other hand, is a passive entity.
#include
#include
#include
int main(int argc, char *argv[]){
int n, smallest, largest, sum, temp;
if(argc < 2){
printf("Syntax: foo val1[val2 [val3 [...]]]\n");
exit(1);
}
smallest = largest = sum = atoi(argv[1]);
for(n = 2; n < argc; n++){
temp = atoi(argv[n]);
if(temp < smallest) smallest = temp;
if(temp > largest) largest = temp;
sum += temp;
}
printf("Smallest: %i\nLargest: %i\nAverage: %i\n", smallest, largest, sum / (argc - 1));
return 0;
}
How do you draw a Christmas tree and presents in qBasic?
Drawing natural looking trees in any programming language is difficult. The problem is trees (and many other living things) grow in a fractal manner, so look up "fractal mathematics" for ideas. If you don't want to do this research, then you can draw one on paper as you think it should look and hand code the program to exactly duplicate your paper drawing (but when I tried this in the early 1980s it came out looking worse than "a Charlie Brown Christmas Tree").
As to presents and decorations, they are quite trivial as they are almost always regular geometric shapes.
Just remember to have at least some of the lights flashing on and off and have Santa Claus in his Sleigh with all his Reindeer do a flyby in the background! These are all simple animations and much easier than coding a natural looking tree.
In my case back in the early 1980s I approximated a simple "step, scale, and repeat" type fractal to create the branches using some special graphics operations in the special purpose graphics programming language that I was using that qBasic does not have (although you could implement something like them with several subroutines that your main program would call). Although it still wasn't perfect it did produce a feel of a natural looking tree without requiring any really complicated code. I won the "Most Original Tree" prize at work that year and the next year was asked to rewrite it slightly (without animations) so it could be photographed for the Company Christmas Card!
What is the code to print odd numbers from 20 to 30 in qbasic?
The following code will produce a list of numbers in steps of 2. It can be modified for any start & end number, and the size of the step.
start% = 21
end% = 29
FOR num% = start% TO end% STEP 2
PRINT num%
NEXT
The above code will produce the results 21,23,25,27 & 29