Happy holi in coding style
WISH HAPPY HOLI USING C LANGUAGE:
follow these steps :
1. open code blocks and select new project:
2. select console application :
3. click on next button and choose c language:
4. provide project title as well as project path:
now you can see that the main window is open , so write the code here:
#include <stdio.h>
#include <wchar.h>
#include <stdlib.h>
#include <locale.h>
int i,j;
void delay()
{
for(i=0; i<1000; i++)
for(j=0; j<3000; j++)
{}
}
void delay1()
{
for(i=0; i<100000; i++)
for(j=0; j<3000; j++)
{}
}
void change()
{system("COLOR 9");
delay1();
system("COLOR C");
delay1();
system("COLOR 5");
delay1();
system("COLOR E");
delay1();
}
int main(void)
{
char *locale = setlocale(LC_ALL, "");
FILE *in = fopen("holi.txt", "r");
wint_t c;
system("COLOR E");
while ((c = fgetwc(in)) != WEOF)
{ if(c!=' ')
delay();
putwchar(c);
}
fclose(in);
while(1)
{
change();
}
getch();
}
download holi.txt file
you must keep the c project file that is "happy holi" and the simple text file that is "holi.txt"
in same folder or path.
output screen:
i hope you like it.
see also :↓↓↓↓↓↓↓↓↓
how to start programming
first programming language
follow these steps :
1. open code blocks and select new project:
2. select console application :
3. click on next button and choose c language:
4. provide project title as well as project path:
now you can see that the main window is open , so write the code here:
#include <stdio.h>
#include <wchar.h>
#include <stdlib.h>
#include <locale.h>
int i,j;
void delay()
{
for(i=0; i<1000; i++)
for(j=0; j<3000; j++)
{}
}
void delay1()
{
for(i=0; i<100000; i++)
for(j=0; j<3000; j++)
{}
}
void change()
{system("COLOR 9");
delay1();
system("COLOR C");
delay1();
system("COLOR 5");
delay1();
system("COLOR E");
delay1();
}
int main(void)
{
char *locale = setlocale(LC_ALL, "");
FILE *in = fopen("holi.txt", "r");
wint_t c;
system("COLOR E");
while ((c = fgetwc(in)) != WEOF)
{ if(c!=' ')
delay();
putwchar(c);
}
fclose(in);
while(1)
{
change();
}
getch();
}
===================================================================
you can see that in main function i am importing a file that is "holi.txt"
this file is a simple text file, in this text file i am designed the "happy holi" or output page.
download "holi.txt" file ,, link is given below.
you must keep the c project file that is "happy holi" and the simple text file that is "holi.txt"
in same folder or path.
output screen:
i hope you like it.
see also :↓↓↓↓↓↓↓↓↓
how to start programming
first programming language
Good! Keep it up!
ReplyDeleteThankyou
DeleteAwesome Post. Thanks for share with us
ReplyDeleteNotepad Tricks In Hindi
thanks
Delete