ShopDreamUp AI ArtDreamUp
Deviation Actions
/*
Name: <type your name, as shown on your student ID>
Admin No:
Class:
*/
<stdio.h>
PI 3.14159
void
main(void)
{
//Lab5b.c
float length,radius,height,volume;
char selection;
printf(
"A: Calculate volume of a cube.\n");
printf(
"B: Calculate volume of a cylinder.\n");
printf(
"C: Calculate volume of a sphere.\n");
printf(
"Please select A, B or C.\n");
<fE-Xclusive Ryona
44 Subscribers
In this section, you will find exclusive images of the page and small videos that I will upload little by little.
$1/month
2014May14 - CPPS - Visual Studio Lab8a.c
#include<stdio.h>
#define LIMIT 6178
void main (void)
{
//Lab8a.c
int number,total,difference,count;
printf("Keep entering number between 10 and 1000\n");
printf("At each entry, cummulative total is tallied\n");
printf("The objective is Keep entering number between 10 and 1000 until it exceed LIMIT\n");
total=0;//initialize starting value
count=0;//initialize count
difference=0,number=0;
do
{
printf("Keep entering number between 10 and 1000\n");//prompt & capture numbers
scanf("%d",&nu
2014May9 - CPPS - Visual Studio Lab7a.c
#include<stdio.h>
void main (void)
{
//Lab7a.c
int loopCount,mark,total;//declare variables used, refer to bold prints
char grade;
total=0;//initialize starting value
loopCount=0;//initialize loopCount
while(loopCount<5)//check if loop still required
{
printf("Please enter mark for question %d\n",loopCount+1);
scanf("%d",&mark);
if(mark<0 || mark>20)
{
printf("You have entered an invalid component mark, try again\n");
continue;
}
total
2014May7 - CPPS - Visual Studio Lab6b.c
#include<stdio.h>
void main (void)
{
/*
//Lab6a.c
int x,number,smallest,largest;//declare variables used
printf("Enter 10 integer numbers from 0 to 100.\n");
smallest=100;//start smallest and largest numbers at the extreme ends
largest=0;
for(x=0;x<10;x++)
{
printf("Enter number now: \n");
scanf("%d",&number);
if(number<smallest)smallest=number;//replace if TRUE
if(number>largest)largest=number;//replace if TRUE
}
printf("Smallest = %d, Largest = %d\n",smallest,largest);
*/
2014May6 - CPPS - Visual Studio Lab5b.c
/*
Name: <type your name, as shown on your student ID>
Admin No:
Class:
*/
#include<stdio.h>
#define PI 3.14159
void main(void)
{
//Lab5b.c
float length,radius,height,volume;
char selection;
printf("A: Calculate volume of a cube.\n");
printf("B: Calculate volume of a cylinder.\n");
printf("C: Calculate volume of a sphere.\n");
printf("Please select A, B or C.\n");
scanf("%c",&selection);
switch (selection)
{
//case:
case 'A': printf("Enter cube length");
scanf("%f",&length);
volume=(
© 2014 - 2024 Ongpohhuatiloveu2
Comments0
Join the community to add your comment. Already a deviant? Log In