C arrays 🗃️

preview_player
Показать описание
C arrays tutorial example explained

#C #arrays #tutorial

int main()
{
// array = a data structure that can store many values of the same data type.

//double prices[] = {5.0, 10.0, 15.0, 25.0, 20.0};
double prices[5];

prices[0] = 5.0;
prices[1] = 10.0;
prices[2] = 15.0;
prices[3] = 25.0;
prices[4] = 20.0;

printf("$%.2lf", prices[0]);

return 0;
}
Рекомендации по теме
Комментарии
Автор

#include <stdio.h>

int main()
{
// array = a data structure that can store many values of the same data type.

//double prices[] = {5.0, 10.0, 15.0, 25.0, 20.0};
double prices[5];

prices[0] = 5.0;
prices[1] = 10.0;
prices[2] = 15.0;
prices[3] = 25.0;
prices[4] = 20.0;

printf("$%.2lf", prices[0]);

return 0;
}

BroCodez
Автор

suprisingly not an indian man but still pretty good.

monkeygodemperor.
Автор

So nice to view this before my exam! Your video's are always well explained and short enough for my attention span :)

lauraborghijs
Автор

Please make a series on x86 Assembly language. Or include some videos on Assembly in vids for other languages like C, that support in-line Assembly. Technically, x86 Assembly (32 bit) is not the same as x64 Assembly (64 bit), so I don’t know how it would work for you, but it would definitely be appreciated by the community!

robinpage
Автор

Got 27/30 on final exam because of you thank you bro!

accepturfate
Автор

Just learning C atm, can anyone tell me why you would use "double" instead of "float" for a money value which only runs to 2 decimal places like the example here? I know it's more accurate for long numbers but if you're only getting 2 dp values what's the advantage?

MikeR-pqqe
Автор

whats the extension you are using that pops up descriptive code line in a box?

qluktyv
Автор

whatever anything I do or did or anything or after or anytime

ryanalnaser
Автор

Which extension do you use for C on VS code?

nicolet
Автор

whats anoying is that an array is a pointer, i would really enjoy if u did a video about that, need to understand pointers better

Bubatzo
Автор

Hello, I have some delightful news that will brighten your day!

Robert__pv
Автор

What happens if he print the array with no value

zendobod
Автор

Poetic revelation: the essence of refunds

William___ad
Автор

We are pleased to inform you that your Sales Incentive payment has been confirmed.

Sandra__xj
Автор

Here's some code I made with an array:

#include <stdio.h>

#include <stdbool.h>
#include <string.h>
#include <math.h>
#include <ctype.h>

int main(){
double height[2] = {72};
printf("How tall are you? (in inches)\n");
scanf("%lf", &height[1]);
printf("\nI am %.0lf inches tall, ", height[0]);
if(height[0] < height[1]){
printf("I am shorter than you by %.1lf inches.", height[1] - height[0]);
}
else if(height[0] > height[1]){
printf("I am taller than you by %.1lf inches.", height[0] - height[1]);
}
else{
printf("We're the exact same hight!");
}
}

PSIwolf