C print an array with loop 🔃

preview_player
Показать описание
C printing array with loop tutorial example explained

#C #array #loop
Рекомендации по теме
Комментарии
Автор

#include <stdio.h>

int main()
{
double prices[] = {5.0, 10.0, 15.0, 25.0, 20.0, 30.0};

//printf("%d bytes\n", sizeof(prices));

for(int i = 0; i < i++)
{
printf("$%.2lf\n", prices[i]);
}

return 0;
}

BroCodez
Автор

Thanks for tutorial. Please up more C tutorial. I already learn Java from your video but C make it more mindful.

harukasetsuna
Автор

You are the Ultimate Bro!. thank you for your videos

JoeSwick
Автор

This is what i looking for . Thank you .

lemonmelon
Автор

Why would we need to divide the overall Array Size by the size of the first array element? Significance in that?

grkkunp
Автор

Hi,

whats the difference between your for loop and this?

for(int i = 0; i < prices[ i ]; i++)
{
printf("%.2lf\n", prices[ i ]);
}

it still prints all the values in an array.

masterofboarding
Автор

I'm saying it, I miss JavaScript

MeowKiritoMeow
Автор

Why didn't you use len of array instead of sizeof?

asondubuisi
Автор

You didn't explain why you used i. I don't understand. I'm trying it, it's not working.

darkseansamm
Автор

Here's the code I made with this:

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

int main(){
int answers[] = {12, 23, 43, 22, 66, 45, 65, 777, 4985, 2, 487, 59};
for(int i = 0; i < i++){
printf("The answer for question #%d is %d\n", i + 1, answers[i]);
}
}

PSIwolf