Dear learners,
Following is the list of special C programs. These are programs where some special function or logic is used.
- C program to delete a given file.
- Program to perform mathematical operations on characters.
- Printing Box using ASCII values.
- Printing formatted output using ASCII value.
- C program to calculate the power of an integer without use of inbuilt math function.
- Calculate power of an integer using inbuilt pow function.
- Armstrong number
- Bitcoin Trading - Profit Loss Calculation
Program related to SecurityObserve the following interesting C program.
Printing formatted output using ASCII value.
#include<stdio.h>
int main()
{
int i;
for(i=0; i<10; i++)
printf("%c",174);
printf(" HELLO STUDENTS ");
for(i=0; i<10; i++)
printf("%c",175);
printf("\n\n");
for(i=0; i<10; i++)
printf("%c",176);
printf(" HELLO STUDENTS ");
for(i=0; i<10; i++)
printf("%c",176);
printf("\n\n");
for(i=0; i<10; i++)
printf("%c",257);
printf(" HELLO STUDENTS ");
for(i=0; i<10; i++)
printf("%c",258);
return 0;
}
Output of the Program:
|
C
program to print memory occupied by int, float and char variables.
#include<stdio.h>
int main()
{
int i;
float f;
char ch;
printf("Size of int variable: %d \n",sizeof(i));
printf("Size of float variable: %d \n",sizeof(f));
printf("Size of char variable: %d \n",sizeof(ch));
return 0;
}
Output
of the Program:
Size of int variable: 4
Size of float variable: 4
Size of char variable: 1
Note: Output of the program may be different on your
computer...
|
C program to use Arrow keys.
#include<stdio.h>
int main()
{
int
chr1, chr2;
printf("Press
any arrow key...\n");
chr1
= getch();
if
(chr1 == 0xE0) //to check scroll key interrupt
{
chr2 = getch(); //to read arrow key
switch(chr2)
{
case 72: printf("UP ARROW KEY PRESSED\n");
break;
case 80: printf("DOWN ARROW KEY PRESSED\n");
break;
case 75: printf("LEFT ARROW KEY PRESSED\n");
break;
case 77: printf("RIGHT ARROW KEY PRESSED\n");
break;
default: printf("OTHER KEY PRESSED: %d %d\n", chr1, chr2); break;
};
}
return 0;
}
Output of the Program:
Press
any arrow key...
UP
ARROW KEY PRESSED
|
Good collection of special C programs.
ReplyDeleteThank you viewer...
DeleteAmazing Programs!!!!!!!!!
ReplyDeleteEnjoy the power of self learning...Jeetendra...
Deletenice programs very useful for reference
ReplyDeleteEnjoy the power of self learning....
DeleteNice Programs Sirrr....Good For reference
ReplyDeleteGood...keep exploring this site for more interesting C language programs
DeleteNice blog for self-learning...
ReplyDeleteGreat special C Programs....Do post more programs related to graphics..
ReplyDeleteIt is really useful for preparation...
ReplyDeleteAwesome blog for c programming.........
ReplyDeleteIt is Really help for Developing my logic Rearing programming languages
Please put some mini projects regarding this...
Thank You Sir
Ref: www.ilovecodes.blogspot.com
ReplyDeleteNice one Easy to Understand
ReplyDeleteThank you Tech Robers.
Deletefor c programming interview questions click here https://youtu.be/Uu8AcuJF5FE
ReplyDeleteReally Useful Contents
ReplyDeleteNice job...
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteખુબ સરસ
ReplyDelete