Assuming you're using the C Programming language (as you did not specify any other), and that you're making some sort of arithmetic tester, a simple answer would be:
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main()
{
time_t seconds;
time(&seconds);
srand((unsigned int)seconds);
int num1 = (rand()%100);
int num2 = (rand()%100);
int sum = num1 + num2;
int ans;
printf("What is %d + %d? ", num1, num2);
scanf("%d", &ans);
if(ans == sum) printf("Correct!");
else printf("Wrong, correct answer is %d", sum);
return 0;
}
To write a C++ program to display the student details using class and array of object.
identification division. program-id. greatest. environment division. data division. working-storage section. 77 a pic 999. 77 b pic 999. 77 c pic 999. procedure division. greatest. display "ENTER THE THREE NUMBERS:". accept a. accept b. accept c. if a > b and a > c display a "is greatest" else if b > c display b "is greatest" else display c "is greatest". display " thank you". stop run.
you do this 10 print "0112358132134" use the whole of the thing
Write a program which takes the temperature in farhenheight.the program should display the farhenheight temperature as well as centigrade. C= (f-32)*5/9
A C++ program can be used to write C programs that will display 10 lines of biodata. Many types of C programming can be written with a C++ program.
To write a C++ program to display the student details using class and array of object.
write a c program to accept a number and generate a square root cube and exponential values
By learning how to program on C+.
Start accept 7 number calculate sum print sum stop
identification division. program-id. greatest. environment division. data division. working-storage section. 77 a pic 999. 77 b pic 999. 77 c pic 999. procedure division. greatest. display "ENTER THE THREE NUMBERS:". accept a. accept b. accept c. if a > b and a > c display a "is greatest" else if b > c display b "is greatest" else display c "is greatest". display " thank you". stop run.
you do this 10 print "0112358132134" use the whole of the thing
I know how to do this and you need to know how to do this. Why don't you do your best at writing this program and if it does not work then ask for help. You will not learn anything if I give you the answer.
C programm
program SumAndDifference; var num1, num2, sum, difference: integer; begin write('Enter first number: '); read(num1); write('Enter second number: '); read(num2); sum := num1 + num2; difference := num1 - num2; if sum > difference then written('The sum is greater: ', sum) else written('The difference is greater: ', difference); end. This program will prompt the user to enter two numbers, calculate their sum and difference, and then compare the two values. If the sum is greater than the difference, it will display the sum; otherwise, it will display the difference.
Write a function that implements an algorithm that checks to see if a particular integer is prime (returning a boolean). Write a program that uses that function on each number from 1 to 100, and if true, displays that number.
write a program to display your name age class schoolname e-mail 2hobby based on choice
Faisal