This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* C program to check whether a given 5 digit number is palindrome or not | |
* (c) www.c-program-example.com | |
*/ | |
#include<stdio.h> | |
int main() { | |
int num, rem, i, rev = 0, num1, count = 0; | |
printf("Enter a five digit number:\n"); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* C Program to demonstrate increment and decrement operators */ | |
main() | |
{ | |
/* | |
* ++i -> i incremented before i is used. | |
* --i -> i decremented before i is used. | |
* j++ -> j is incremented AFTER j has been used. | |
* j-- -> j is decremented AFTER j has been used. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
#include<stdlib.h> | |
int main() { | |
int d, m, y, year, month, day, i; | |
printf("Enter date of birth (DD MM YYYY) :"); | |
scanf("%d %d %d", &d, &m, &y); | |
if( (d > 31) || (m > 12) || (y < 1900 || y >= 2100) ) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main () { | |
int num_denominations, coin_list[100], use_these[100], i, owed; | |
printf("Enter number of denominations : "); | |
scanf("%d", &num_denominations); | |
printf("\nEnter the denominations in descending order: "); | |
for(i=0; i< num_denominations; i++) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static bool IsFileLocked(FileInfo file) { | |
FileStream stream = null; | |
if(!file.Exists) | |
return false; | |
try { | |
stream = file.Open(FileMode.Open, FileAccess.Read, FileShare.None); | |
} catch (IOException) { | |
// the file is unavailable because it is: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
main() | |
{ | |
char data[100]; | |
double num1, num2; | |
printf("\nPlease enter a number ==> " ); | |
gets(data); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdlib.h> | |
#include<stdio.h> | |
void main() { | |
long num, div, n1; | |
int flag, digit, pos, tot_dig; | |
printf("\nEnter a number: "); | |
scanf("%ld", &num); | |
if(num == 0) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*********************************************************** | |
* You can use all the programs on www.c-program-example.com | |
* for personal and learning purposes. For permissions to use the | |
* programs for commercial purposes, | |
* contact info@c-program-example.com | |
* To find more C programs, do visit www.c-program-example.com | |
* and browse! | |
* | |
* Happy Coding | |
***********************************************************/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*********************************************************** | |
* You can use all the programs on www.c-program-example.com | |
* for personal and learning purposes. For permissions to use | |
* the programs for commercial purposes, | |
* contact info@c-program-example.com | |
* To find more C programs, do visit www.c-program-example.com | |
* and browse! | |
* | |
* Happy Coding | |
***********************************************************/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*********************************************************** | |
* You can use all the programs on www.c-program-example.com | |
* for personal and learning purposes. For permissions to use | |
* the programs for commercial purposes, | |
* contact info@c-program-example.com | |
* To find more C programs, do visit www.c-program-example.com | |
* and browse! | |
* Happy Coding | |
***********************************************************/ | |