C format specifiers 🔧

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

#C #format #specifiers

// format specifier % = defines and formats a type of data to be displayed

// %c = character
// %s = string (array of characters)
// %f = float
// %lf = double
// %d = integer

// %.1 = decimal precision
// %1 = minimum field width
// %- = left align

float item1 = 5.75;
float item2 = 10.00;
float item3 = 100.99;

printf("Item 1: $%8.2f\n", item1);
printf("Item 2: $%8.2f\n", item2);
printf("Item 3: $%8.2f\n", item3);

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

#include <stdio.h>

int main(){

// format specifier % = defines and formats a type of data to be displayed

// %c = character
// %s = string (array of characters)
// %f = float
// %lf = double
// %d = integer

// %.1 = decimal precision
// %1 = minimum field width
// %- = left align

float item1 = 5.75;
float item2 = 10.00;
float item3 = 100.99;

printf("Item 1: $%8.2f\n", item1);
printf("Item 2: $%8.2f\n", item2);
printf("Item 3: $%8.2f\n", item3);

return 0;
}

BroCodez
Автор

I think you are the best C explainer in Youtube. I'm subscribed and enjoying very much. I'll follow your Course to the end because of it.

UracromToromag
Автор

C was the first language I learnt, Nice video.
From Mozambique.

laerciomassapa
Автор

Straight to the point, love that. Congrats, bro!

CruelCDO
Автор

most of the videos are very short and easily understandable ! Thankyou for your efforts BRO!!!

mebanteisalahe
Автор

Hey Bro! Love your videos, really helped me learn java. I'd love to see functional programming videos on your channel after C, if that's possible

(thanks for the content btw)

vidhukant
Автор

Great!!! you tutorials and videos have helped me a alot great explaination :) you deserve 1 million subs man again Thanks!

BugbountyPOCs
Автор

the explanation is on another level...you helped me a lot brother thankyou👏👏

brianmanoti
Автор

I made it here very quickly. I hope you stream soon

capainsharp
Автор

your explain is very good i will watch all your videos

សម្បត្តិដាណែត
Автор

Bro code thanks 💯. You just made my day

mosopefoluwaadebawojo
Автор

printf("You're too good bro!");

amayrali
Автор

i know the syntax is similar but is it the same for java ?

fernandocamarena
Автор

Hello Bro, hi everyone. So in the previous video, you said % is used to display the value of a variable. Here in this video, you said $ is used to insert a value wherever we want. I'm a bit confused. What's the difference?

okiukz
Автор

how can i format 1000 to 1.000 easily in C specially with <stdio.h>,

timesweird