Best regards ! With Linux as a bro told me : system("sleep 1"); system("clear"); Commands are used with additional header . Computer clock works with high frequency that's why we use these two functions below.
for people coding in Linux you can use #include instead of #include . Then you can use system() to enter a bash command (e.g. system("sleep 1") or system("clear))
@@programmingtestsandproje thanks bruhhh so much... I wish you happiness!!!😍🥰 Bruh and one more thing.... How do you get rid of all the unwanted output and get a clean and neat output...?? Do you have a video on this... Or please tell me how to do that!!! Plzzzz
you can get the desktop clock if you use the time.h header, you can do it like time_t s; s = time(NULL) and as for the seconds counting backwards, you just need to use basic maths, just tell it to print 59 minus the seconds which will make the place in the seconds count down instead of up and voilá, i've done it and it works
So for system(CLS); how would i implement this on xcode because I made a clock that tells day and time but since it's in an Infinite loop. It prints out every iteration. So my screen is filled a lot of line of code.
Since the system command is running system functions, the command to execute here is dependent on the operating system you’re running the script from. The Windows command is cls for clear screen, but if you’re on a linux/unix type OS like Mac (I’m assuming you are since you mentioned xcode) the commend should be clear, so system(“clear”), but like someone else mentioned, writing out an escape sequence instead is better practice since this won’t be OS dependent
Hi sir, it won't working when I am giving input as 0 0 0 for h, m, s in online compiler.Then what can i do for that. Is there any need of installation of any other software.
bro i'm making this program in c++ and the program is running good but the problem is the time between every second is so fast that i can't even read the output please solve this
@@programmingtestsandproje #include #include int main() { int h,m ,s,d; int d=1000; //delay of 1000 miliseconds and we will use it in the function sleep printf("set time: "); scanf("%d%d%d",&h,&m,&s); if(h>12 || m>60 || s>60) { printf("ERROR ! "); exit(0); } while(1) //this is an infinite loop and anytjing inside will repeat isdelf to infinity { s++; if (s>59) { m++; s=0; } { if (m>59) h++; m=0; } if (h>12) { h=1; } printf(" Clock:"); printf( " %02d:%02d:%02d" ,h,m,s); //this writes one tome in format 00:00:00 sleep(d); //the function sleep slow down the while loop and make it more like a real clock system("cls"); // this clears the screen } }
Best regards !
With Linux as a bro told me :
system("sleep 1");
system("clear");
Commands are used with additional header .
Computer clock works with high frequency that's why we use these two functions below.
Bro it's awesome anybody can learn it finally got a legit program
th-cam.com/channels/vX4ERU0DvgQqR1Uw4WpNuw.html
I started doing all the challenges on codecademy that I've done in python but it's completely different and so much longer to implement.
for people coding in Linux you can use #include instead of #include . Then you can use system() to enter a bash command (e.g. system("sleep 1") or system("clear))
I am a windows user, but thanks! You helped people like me, who dont know so much
love you
Thanks for better explanation 🙂
Meanwhile I'm trying to figure out why my "Hello World" is giving me segmentation fault error...😂👌
haha
You just have to close previous exe file.. 🤷♂️
@@prathmeshbatane8740 Lol
@@prathmeshbatane8740 😂😂😂
Lol
That was amazing
Love the way you teach
Thanks for making this awesome video
this is great. Looking forward to upcoming projects
For those whose time stuck at 00.00.1
Try d=1 instead of 1000 cause the difference is in second
the real hero
Thanx Bro 🥳
Thank you
thank u bro
thanks
Thanking so much.....
One of the great TH-cam channel..
I am learn something new.... Super super superb lots and lots of Thanking you
Very cool, I see you from Brazil!
great
I am having problem in declaring sleep() function
intense upload Programming Tests and Projects. I shattered that thumbs up on your video. Keep up the quality work.
👍
Would this run slow eventually because each second would be 1000 ms plus however long it takes to execute the loop?
Simple yet deadly
Outstanding work
Thank you so much bro🔥
Awesome content☺
This is beginners stuff!!! Really!.
i love ur vscode font colors! How can I get that same one?
Too good
love the music bro and thnx
Do c into graphic programs pls that would be very usefull... how to sincronize and in tegrate graphic windows and c code...
bro u maked a litlle mistak in ur code
if(h>12)
{
h=0;
}
h suposed to back to 0 not 1
So nicee
nice
Great, Love from UK🇬🇧
I want to learn how to form a project of restrictions enzymes in C programming
Amazing ❤️
amazing and understandable.
Really like it bro 👍👍
Awsome 🔥🔥🔥🔥🔥
Wow easy and simple
👍
👍
👍
I'll try it now ❤️❤️
I thought that the clock had to get the actual real time... and i found time.h, works like a charm! lol
Super, bro.
Awesome.
Niceeee...
❤❤❤❤
nice bhai
wow
Nice bro
Bruhhh!!! That's awesome...
Could you tell me what your theme is!??? Plzzzz?? It looks fantastic!!!
thank you, my theme is styrokai++
@@programmingtestsandproje thanks bruhhh so much... I wish you happiness!!!😍🥰
Bruh and one more thing....
How do you get rid of all the unwanted output and get a clean and neat output...?? Do you have a video on this... Or please tell me how to do that!!! Plzzzz
Really good
Nice ! Easy to Understand.
salut mon frere !
Thanks dude , do u have any idea how can i do that in a real project , programming an integer card , with monitor ... ?
My function "sleep(d)" keeps getting errors, "implicit declaration of function 'sleep'"
Sleep() function is with a capital S, Sleep(d);
I'm trying this on an online compiler and the code #include shows as fatal error: windows.h: No such file or directory
ye duh
You can't include header files in online compiler. You need to carry this out on an offline compiler like VSCode or CodeBlocks.
@@punya3597 thanks
@@punya3597 same happened to me in vscode as well
Will windows.h work in linux
@@dilipkn7339 I don't think linux includes windows.h library, you might have to port the functions you need from other header files e.g.Xlib.h
Where I can excute this program can anyone tell me about it
0:21 what its mean , without watching ur peogramme(video) or without seeing o/p ??
It worked!
In which compiler did you try?
@@anjanabhat6576 Codeblocks 16.01
It is not working in turbo c++...can you please tell me why
Thank you bro 🌹
Why use file ?
@@Dee71911 it contains the Sleep() function
What is the use of delay of 1000 ms
And using it in sleep function
Is it possible to make this the desktop clock? Perhaps add quirks like Seconds counting back and forward while still accumulating time?
th-cam.com/channels/vX4ERU0DvgQqR1Uw4WpNuw.html
you can get the desktop clock if you use the time.h header, you can do it like time_t s; s = time(NULL) and as for the seconds counting backwards, you just need to use basic maths, just tell it to print 59 minus the seconds which will make the place in the seconds count down instead of up and voilá, i've done it and it works
So for system(CLS); how would i implement this on xcode because I made a clock that tells day and time but since it's in an Infinite loop. It prints out every iteration. So my screen is filled a lot of line of code.
system("cls")
Same problem !
Since the system command is running system functions, the command to execute here is dependent on the operating system you’re running the script from. The Windows command is cls for clear screen, but if you’re on a linux/unix type OS like Mac (I’m assuming you are since you mentioned xcode) the commend should be clear, so system(“clear”), but like someone else mentioned, writing out an escape sequence instead is better practice since this won’t be OS dependent
wich theme you're using
Can I do in android phone with Turbo C app???
Don't know why I copied the exact code still the clock does not run it os taking the inputs of h m s and not running afterwards
If system("cls") does not work on your terminal, try system("clear").
Use clrscr();
Why is every project idea ether incredible hard or super ez
Hi sir, it won't working when I am giving input as 0 0 0 for h, m, s in online compiler.Then what can i do for that. Is there any need of installation of any other software.
bro i'm making this program in c++ and the program is running good
but the problem is the time between every second is so fast that i can't even read the output
please solve this
Can u pls give me the code.... I want to try... Pls pls
try increasing the value of "d".
thxxx for the help
what vsc theme is that?
I am new at C.
So can someone explain why he put %2d instead of %d while printing the time after the 3 if statements?
so that each value appears like 01 and not 1
@@samuelogboye thanks mate
Thanks a lot
bro there is a delay with the real time....the second in this program increases slow in comparison of real time....how to solve this plz tell....
Not going to lie it's looks kinda easy😅
for you its running continously but for me it was stuck up at 00:00:01 !!! any solution
i have tried ,but not working it says "sleep(d)^ not declared!"
I am using now the Code Blocks but it stuck in 10:00:00 and I already tested the "d=1" instead of d=1000.
01:00:00*
im getting output as ERROR !
Thank you soo much 😍
what compiler do you user? much better looking than codeblocks lol
VS Code
Can you send the code now bro please
I don't know what I did wrong but it keeps asking for input infinitely.
using system() function is a bad practice, you're better off using an escape sequence like \033[A which will work in every system
@Yor Kar cuz there's bad in it
When I run this and set time at 000 it shows error of process returned why
Can someone tell me what this theme he uses for VS Code is
Styrokai
Code breaks for me at ```printf("
%02d:%02d:%02d", h,m,s)``` does not print the time
same
Wouldn’t you want
if(h>12|| m>59|| sec>59)
instead ?
second passes instantly so 59 sec will be a minute the next moment
You didn't show the sleep function
Bro memu projects chedham anukuntunnam memu projects ela cheyyali, maaku projects Cirtificate kaavali bro resume lo pettukovadaniki
What's there in 7 line.. Please tell
Why should we use delay
Some corrections in your code.
while(1)
{
s++;
if (s>59)
{
m++;
s=0;
}
if (m>59)
{
h++;
m=0;
}
if (h>11)
{
h=0;
}
Which Ide??
What is the sleep command in C++
It puts you to sleep .
still waiting for new videos its been 2 years🙂
Bro in which compiler you did this.
Hi
While executing it shows like compilation terminated and no such file or directory
Dont use #include bro
Bro it stuck in 00:00:01 whats the problém??
show me your code
@@programmingtestsandproje same problem bro
@@michaelmoore6642 show me your code so i can see what you did wrong
@@programmingtestsandproje
#include
#include
int main()
{
int h,m ,s,d;
int d=1000; //delay of 1000 miliseconds and we will use it in the function sleep
printf("set time:
");
scanf("%d%d%d",&h,&m,&s);
if(h>12 || m>60 || s>60)
{
printf("ERROR !
");
exit(0);
}
while(1) //this is an infinite loop and anytjing inside will repeat isdelf to infinity
{
s++;
if (s>59)
{
m++;
s=0;
}
{
if (m>59)
h++;
m=0;
}
if (h>12)
{
h=1;
}
printf("
Clock:");
printf( "
%02d:%02d:%02d" ,h,m,s); //this writes one tome in format 00:00:00
sleep(d); //the function sleep slow down the while loop and make it more like a real clock
system("cls");
// this clears the screen
}
}
try d=1 cause the time is in seconds not in milliseconds
Where we have to do this I mean any software??
So "int h,m,s" is like
"int h;
int m;
int s;"?
which theme you use for vscode😊
Styrokai++
can i know what the algorithm,pseudocode and flowchart.
Is windows.h required in android?
Hi can i know why my second kinda slow
i am having problems with printf("set time :
");
Who was watching at 0.25x 😂😅
is it only run in vs code???