/*
program in c to print following pattern...
& & & & & & &
& & & & &
& & &
&
*/
#include<stdio.h>#include<conio.h>void...
9 Mar 2013
/*program to generate nth ugly number
Ugly numbers are numbers whose only prime factors are 2, 3 or 5. The sequence
1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, ...
shows the first 11 ugly numbers. By convention, 1 is included.
*/# include<stdio.h># include<stdlib.h>/*This function divides a by greatest divisible power of b*/int...
/*
program to check whether a given no. is a ""perfect no."" or not.
a perfect number is a positive integer that is equal to the sum of its proper positive divisors, that is, the sum of its positive divisors excluding the number itself
The first perfect number is 6
*/
#include<iostream.h>#include<conio.h>void main(){clrscr();int...
8 Mar 2013
/*
program to check whether a string is palindrome or not in c++
*/
#include<iostream.h>#include<conio.h>#include<string.h>#include<stdio.h>void main(){clrscr();int i,j,k,flag=0;char a[80];cout<<"Enter the string:";gets(a);k=strlen(a);for(i=0,j=k-1;i<=j;i++,j--){if(a[i]!=a[j]){flag=1;break;}}if(flag>0)cout<<"String...
/*
solution to graplin inline challenge level-1
*/
#include<stdio.h>#include<conio.h>#include<string.h>void cutstr(char *,int ,int );char arr1[150]={'\0'};char arr2[150]={'\0'};char arr11[]="FourscoreandsevenyearsagoourfaathersbroughtforthonthiscontainentanewnationconceivedinzLibertyanddedicatedtothepropositionthatallmenarecreatedequalNowweareengagedinagreahtcivilwartestingwhetherthatnaptionoranynartionsoconceivedandsodedicatedcanlongendureWeareqmetonagreatbattlefiemldoftzhatwarWehavecometodedicpateaportionofthatfieldasafinalrestingplaceforthosewhoheregavetheirlivesthatthatnationmightliveItisaltogetherfangandproperthatweshoulddothisButinalargersensewecannotdedicatewecannotconsecratewecannothallowthisgroundThebravelmenlivinganddeadwhostruggledherehaveconsecrateditfaraboveourpoorponwertoaddordetract";char...
Subscribe to:
Posts (Atom)