/*A PROGRAM TO COUNT NUMBER OF LETTERS IN ARRAY ACCORDING TO RANGE OF THEIR ASCII VALUES*/#include#define TRUE 1//MACROS REPRESENTING TRUE & FALSE#define FALSE 0int main(){ int i=0,hi=0,lw…
/*A PROGRAM TO ENTER ARRAY & REPLACE PERTICULAR CHARACTERS OF ARRAY*/#includeint main(){//char choose;int i;char c=0;char arr[40]="I M ANU..ARE YOU HAPPY";for(i=0;(c=arr[i])!='\0&#…
/*A PROGRAM TO SHOW BEHAVIOUR OF CONDITION... for(x=0,y=1000;y>0;x++,y=y/10)*/#includeint main(){ int x,y; for(x=0,y=1000;y>0;x++,y=y/10)//CONDITION IS CHECKED FOR ONLY y....BUT W…
/*A PROGRAM TO SHOW BEHAVE OF CONDITION for(y=10;(x=y)>0;y--)*/#includeint main(){ int x=0;int y=0,i=0; for(y=10;(x=y)>0;y--)//WILL 1ST ASSIGN THE VALUE OF y TO x...then check IF …
/*PROGRAM TO FIND MONTHLY INCOME ,,DAILY INCOME,,& WEEKLY INCOME IF U KNOW SALARY OF 1 HOUR*/#includeint main(){ char choice; int wph=500;//I HAD 500 INCOME OF 1 HOUR// float…
/AN IMPLEMENTATION TO FIND SQRT //#includefloat sqrt1(float);int main(){ float a; float no; printf("ENTER THE NUM WHOSE SQRT IS TO FIND:\n"); scanf("%f"…
/*A PROGRAM TO FIND AREA IF IT IS SQUARE OR TRIANGLE*/#includeint main(){ char choice; float base,h; float a; printf("ENTER THE CHOICE:\n");//ENTER THE CHOICE WH…
//AN IMPLEMENTATION TO GET SUBSTRACTION OF TWO VALUES V& IF SUBSTRACTION IS -VE THEN GET 2'S COMLEMENT//#includeint main(){ int x,y,c=0; printf("ENTER THE 2 VALUES:\n"…
//TO FIND THE COLOR CODE //#includeint main(){ char ch=1,chess;do
{
printf("ENTER THE 1ST CHARACTER OF COLOR:\n"); scanf("%c",&ch);//case is of character…
/*A PROGRAM TO COUNT NUMBER OF ELEMENTS IN ARRAY OTHER THAN 0..*/#includeint main(){int count=0,i,arr[7]={0,1,2,3,0,4,7};//SUPPOSE I HAVE THIS ARRAY IN WHICH THERE ARE 2 0'S...MEANS LEAVING 0�…
/*..PROGRAM TO PRINT 1BYTE FROM 4 BYTES OF INT..*/#includeint main(){ int i=45678,j=0;//this is 32 bit system //so int is of 32 bits..// j=i;//PRESERVE VALUE IN J...BCZ IIN I ..WE ARE S…
/*PROGRAM TO GET MULTIPLICATION OF TWO MATRICES*/#includeint main(){ int i,j,r,c,first[5][5],second[10][10],sum[10][10]; printf("enter the no. of rows u want to enter in matrix\n&q…
*PROGRAM TO GET SUBSTRACTION OF TWO MATRICES*/#includeint main(){ int i,j,r,c,first[5][5],second[10][10],sum[10][10]; printf("enter the no. of rows u want to enter in matrix\n"…
/*PROGRAM TO GET SUM OF TWO MATRICES*/#includeint main(){ int i,j,r,c,first[5][5],second[10][10],sum[10][10]; printf("enter the no. of rows u want to enter in matrix\n");//ent…
*A PROGRAM TO DELETE THE ELEMENT FROM ARRAY*/#includeint main(){int i=0,j=0,arr[5]={1,2,3,4,5};printf("ENTER THE POS FRM WHERE U WANT TO DELETE ELEMENT\n");scanf("%d",&j);//SU…
*A PROGRAM TO REPRESENT ..PUT COMBINATION OF 2 SORTED ARRAYS INTO 3RD ARRAY BY SORTING*/#includeint main(){ int j=0,i,arr1[5]={1,3,5,6,9};//1ST SORTED ARRAY int arr2[5]={0,2,4,7,8};//2N…
//Program to reverse the array//#includeint main(){ int j,sum=0,arr[4],i; for(i=0;i=0;i--)//will not allow perticular element of array to get minused from sum of all elements in array.…
/*A PROGRAM TO FIND SMALLEST NUMBER OF ALL ELEMENTS IN ARRAY */#include#define MAX 999999999//ENTER VALUE IN MAX ..THE LARGEST POSSIBLE VALUE OF INT ..int main(){ int arr[10]; int temp=…
/*A PROGRAM TO GET SUM OF ALL ELEMENTS IN ARRAY & ALSO FIND ITS AVERAGE VALUE */#includeint main(){float avg=0;//AVG VALUE IN FLOAT IS 0 IN ORIGINALLYint arr[10],sum=0;//SUM IS ALSO 0 ORIGINALLY …
*A PROGRAM TO ENTER THE TWO ARRAYS & ADD EACH ELEMENT OF 2 ARRAYS...TO GET SUM OF 2 ARRAYS*/#includeint main(){int arr1[10]={0},arr2[10]={0},arr[10]={0};//MAKE EACH OF ARRAY 0 1STint i;for(i=0;i
/*..AN IMPLEMENTATION TO REPRESENT 3D ARRAY..*///HERE I IS THE ARRAY IN WHICH POSITIONS ACCORDING TO J ARE LEFT...THRN J IS AGAIN AN ARRAY IN WHICH POSITIONS ACCORDING TO K ARE LEFT....//MEANS ULTI…
/*AN IMPLEMENTATION TO SHOW FUNCTION OF TYPEDEF*/#includeint main(){ static char *s[]={"chemistry","maths","physics"}; typedef char*(*ppp)[3];//typedef wi…
/*A PROGRAM TO SEE BEHAVE OF ARRAY OF POINTER & ALSO WHILE PUTTING ADDRESS OF ARRAY OF POINTER INTO DOUBE POINTER*///IN ARRAY OF POINTER,POINTER HAS SOME ADDRESSES OF ARRAYS IN CONTINOUS FORM ...…
*A PROGRAM TO SEE BEHAVE OF POINTER WHEN PUTTING ITS ADDRESS INTO ANOTHER POINTER*/#includeint main(void){ int value=77,num=99; int *pv=&value,*pn=# int **ppi; …
//A PROGRAM TO SEE BEHAVOIUR OF POINTER WITH ++ OPERATOR WHEN * HAS MORE PRIORITY//#include#includeint main(){int i,*a,*s;a=s=(int*)malloc(4*sizeof(int));for(i=0;i
/*..A PROG TO KNOW BEHAVIOUR OF POINTER..*/#includeint main(){int j=1,k=2;int *ptr;ptr=&j;printf("j=%d add of j=%p\n",j,(void*)&j);//printf("k=%d add of k=%p\n",k,(void*)&…
//AN IMPLEMENTATION TO GET SUM OF G.P. SERIES....1 + 1/2 + 1/4 + 1/8 + 1/16......1/POW(2,N)////#include#includeint main(){ float sum=0,l=0,a=0,r=0; int n; printf("ENTER THE …
//AN IMPLEMENTATION TO FIND SUM OF SIN SERIES....x-3x/3!+5x/5!-7x/7!+9x/9!_ _ _ _ _ _ _ _ nx/n!//#includeint main(){ float sum=0; int x,i,j=1,fect=1; printf("ENTER THE VALUE…
//AN IMPLEMENTATION TO CALCULATE THE SUM OF SERIES OF...1 + (1+2) + (1+2+3) + (1+2+3+4)_ _ _ _ _ _ _(1+2+ _ _ +N)//#includeint main(){ int n,i,j,sum=0; printf("ENTER THE VALUE OF …
/AN IMPLEMENTATION TO FIND THE SUM OF SERIES=1! + 2! + 3! + 4!_ _ _ _ _ _ _N!//#includeint main(){ int fect=1,i,n,sum=0; printf("ENTER THE NO:\n"); scanf("%d"…
//AN IMPLEMENTATION TO GET SUM OF SERIES 1 + 1/2 + 1/3 + 1/4 _ _ _ _ _ _ _ 1/n//#includeint main(){ int i,sum=0,n; printf("ENTER THE VALUE OF N: TO GET SUM OF SERIES\n"); …
//AGAIN ANOTHER WAY OF GETING SUM OF SERIES..1+2+3+4...n////TO FIND THE SUM OF N NATURAL NUMBERS//#includeint main(){ int sum=0,n,i; printf("ENTER THE NO:\n"); scanf(&q…
//AN IMPLEMENTATION TO CALCULATE SUM OF 1/1! + 2/2! + 3/3! + 4/4! _ _ _ _ _ _ _ _n/n!#includeint main(){int i,fect=1,num;float sum=0;printf("ENTER THE NUMBER TO GET SUM:");scanf("%d&qu…
/*AN ATTEMPT TO FIND FUNCTION OF \r...*/#includeint main(){ printf("\nab"); printf("\rsi\n");//\r reset position of printf statement from starting ..means overrite p…
//AN INTERESTING GAME TO PLAY USING MADE SRAND & RAND FUNCTION //#include#include#include//to use rand & srand function..time.h header file is used..//time_t sec;//declare variable of time_ti…
/*A NICE PROGRAM TO ENTER THE COMMENT WHICH IS SAVED INTO SOME FILE & READ THAT COMMMENT*/#include#include#includeint main(){ int count,wfd,fd; char arr[100],usr[4]; //memset…
PROG--TO ENTER THE VALUE UPTO '#' CHARACTER & PUT (!!)2 EXCLAMETRY SIGNS AFTER EACH CHARACTER/#includeint main(){ char new[15]; char arr[10]; int i=0,j=0; ar…
/*AN IMPLEMENTATION TO PRINT THE STRING WITH DIFFRENT CONDITIONS USED ..*/#include#includeint main(){int ret=0,k=0,len=0,i;char arr[50];printf("ENTER THE COMENT:\n");k=scanf("%4000[^\n…
//A NICE LOGIC TO GET MAX.SIZE OF POINTER U CAN GET..IN 4 GB RAM..////I GOT 32MB ...OF MAX. FOR POINTER AFTER THAT ..I GOT SEGMENTATION FAULT..//#include#includeint main(){unsigned long long int* ptr…
//AN ATTEMPT FOR CONVERTION OF INCHES TO CM..//#includeint main(){ int cm=0,inch=45; cm=inch*2.54;//multiply inch by 2.54 to convert it into centimeter..// printf("cm=%d\n&q…
//A NICE IMPLEMENTATION TO TURN OFF A SINGLE BIT IN BYTE////get==//kth power of 2 will on that periticular bit..////for eg.0th bit....0000 0001////for eg.1th bit....0000 0010////for eg.2th bit....000…
//A NICE IMPLEMENTATION TO TURN ON A SINGLE BIT IN BYTE OF CHAR////kth bit starts from right hand side////kth power of 2 will on that periticular bit..//for eg.0th bit....0000 0001//for eg.1th bit...…
/PROG--TO SWAP 2 NIBBLS IN A BYTE BY MASKING//#includeint main(){ int i=0,j=0; unsigned char set,byt[20]={0},num,ch,cp; ch=234;//I HAVE THIS NUMBER WHOSE TWO NIBBLES ARE TO BE EX…
/*TO FIND IF NUMBER IS POWER OF 2 USING ANOTHER WAY*/#includeint main(){int x=8;if(((~x+2))==(-x))//x=0000 1000 ~x=1111 0111 ~x+1=1111 1000..last four bits of every power of 2 are same ..not 8 bits..…
/*A PROGRAM TO FIND WHAT HAPPENS WHEN n & (-n)....n*-n....n&(1-n) like operations*/#includeint main(){int a=2;int n=2;printf("n=%d\n",n);//2printf("-n=%d\n",-n);//-2printf…
/PROG--TO CHECK WEITHER TRIANGLE IS EQUILATERAL,ISOSCELES & RIGHT ANGED//#includeint main(){int a,b,c;printf("ENTER THE 3 SIDES OF TRIANGLE:\n");scanf("%d%d%d",&a,&b,&…
/*WHAT HAPPENS IF CHARACTERS & INT VALUES ARE USED IN SWITCH...DID 1 CHAR VALUE & 1 INT VALUE MATCH?*/#includeint main(){int a=1;switch(a)//IT WILL GO INTO DEFAULT CASE ..IT IS BECAUSE...�…
//AN IMPLEMENTATION TO UNDERSTAND THE CHECKING WAY OF LOGICAL AND && LOGICAL OR OPERATORS////LOGICAL AND---//0 0------0//0 1----- 0//1 0----- 0//1 1----- 1//LOGICAL OR---//0 …
/*A IMPLEMENTATION WHAT WILL DO "=" ASSIGNMENT OPERATOR IS USED IN IF CONDITIOON*/#includeint main(){int x,y=9,z=6;if(z=y==8)//z=1 if y==8 condition TRUE//THIS WILL CHECK THE CONDITION 1ST …
/*AN IMPLEMENTATION TO REPRESENT PHONE NUMBER INTO REVERSE ORDER IN WHICH THERE ARE 10 DIGITS *///WE KNOW THAT INT VALUE CAN HAVE ATMOST 9 DIGITS..//#includestatic int j=0;//j is staicvoid rev(int,in…
//TO PRINT THE NOS. BETWEEN 1 TO 100 & 100 TO 1 ...WITHOUT USING LOOP...//TO PRINT LIKE THIS...I MAY USE RECURSION OF FUNCTION ...MEANS IN THE DEFINATION OF FUNCTION AGAIN CALL THAT FUNCTION &am…
.AN IMPLEMENTATION TO CONVERT BINARY NUMBER INTO DECIMAL..*/#include#includeint powi(int,int);//MAKE FUNCTION TO FIND OUT POWER//int main(){ int i=0,num,dec=0,a=0,len,rem; printf("…
//A PROGRAM TO CONVERT DECIMAL NO. INTO BINARY NO.////THIS IS LIKE I M TAKING LCM OF NUMBER TO REPRESENTATION INTO BINARY ...THAT IS A STANDARD TECHNIQUE THAT WE ALWAYS USE...//SO PRESERVE THAT REMAI…
/*ANOTHER IMPLEMENTATION TO PRINT A CHAIN*/#includeint main(){ int c,a,s,n,j,temp,i=1; char choose; printf("ENTER THE NO. OF ROWS||SIZE U WANT TO PRINT IN PYRAMID:\n");…
/*..AN IMPLEMENTATION TO PRINT A CHAIN..*/#includeint main(){ int c,a,s,n,j,temp; char choose; printf("ENTER THE NO. OF ROWS||SIZE U WANT TO PRINT IN PYRAMID:\n"); …
//*..AN ATTEMPT TO MAKE GURUDUARA SHAPE USING STARS..*//#includeint main(){ int c,a,s,n,j,temp; char choose; printf("ENTER THE NO. OF ROWS||SIZE U WANT TO PRINT IN PYRAMID:\…
//A NICE IMPLEMENTATION TO PRINT A PYRAMID USING STARS//#includeint main(){int bl,st,n,i,temp;printf("ENTER THE NO.OF ROWS IN PYRAMID U WANT TO PRINT:\n");//ENTER THE NUMBER OF ROWS OR SIZE…
/*AN ATTEMPT TO MAKE A NICE DESIGN USING C PROGRAM*/#includeint main(){int j=0,i;//for(i=10;i>0;i--){printf("%11c\n", '*');printf("%12s\n","* *");printf(&q…
//PROG--TO COMPARE THE FLOAT NUMBER & INT NUMBER#includeint main(){int i;float f;printf("ENTER THE INT VALUE:");scanf("%i",&i);printf("ENTER THE FLOAT VALUE:");s…
//AN IMPLEMENTATION TO FIND ALL PRIME NOS. UPTO 10 COUNT#includeint main(){int rem=1,i,num=2;while(num < 24)//to print the prime no. upto 23{for(i=2;rem!=0;i++)//check if no. is divisible by any o…
//AN IMPLEMENTATION WEITHER NO. IS PRIME OR NOT////NUMBER WHICH IS NOT MULTILE OF ANY NO. OTHER THAN 1 IS A PRIME NO..FOR EG 2 3 5 7 11 13 17 19 23 ETC...NUMBER WHICH IS MULTIPLE OF OTHER SMALL NO.S …
//AN IMPLEMENTATION TO CHECK WEITHER NO. IS EVEN OR NOT////NUMBER THAT IS DIVISIBLE BY 2 IS EVEN NUMBER ....NO. THAT IS NOT DIVISIBLE BY 2 IS ODD NO.#includeint main(){int num;printf("ENTER THE …
//AN IMPLEMENTATION TO SHOW WORKING OF DIIFRENT SPECIFIERS WITH DIFFRENT LIKE (%3.6d)///#includeint main(){printf("%s\n","HELLO");//will print the string HELLO printf("1st nu…
main file:-//Here i am making my own header file in which i declare all the header file which is used in this program and also declare the prototype of th function which i used in it.//
//BY using …
//AN IMPLEMENTATION TO FIND LCM OF A NO.//#includeint main(){ int i=0,num=0,rem=1;//rem is 1 at starting printf("ENTER THE NO:");//enter the no. whose lcm is to be find …
//AN IMPLEMENTATION TO CHECK WEITHER NO. IS PALINDROME OR NOT...//PALINDROME IS A NUMBER ..THAT BECOMES EXACTLY SAME WHEN REVERSED ////TO CHECK WEITHER NO. IS PALINDROME OR NOT...1ST REVERSE IT &…
//AN IMPLEMENTATION TO FIND FACTORIAL OF A NUMBER//#includeint main(){int fect=1;//fect is 1int i=0;printf("ENTER THE NUM:");//enter the num whose fectorial is to be found..//scanf("%d…
/*AN IMPLEMENTATION TO CHECK WEITHER AN ALPHABET IS VOWEL OR NOT..*/#includeint main(){char ch;printf("ENTER THE CHARACTR\n");scanf("%c",&ch);//all the dealing with ascii val…
/*PROG--TO SHOW DIFFFRENCE BETWEEN ch=1 & ch='1'*/#includeint main(){char ch='1';printf("ch=%c %d",ch,ch);//it prints character with %c & ascii value with %d ../…
/*A PROGRAM TO PRINT VALUES OF DATA TYPES FROM LIMITS.H WITHOUT USING ANY VARIABLE*/#include#includeint main(){printf("NO. OF BITS IN CHAR=%d\n",CHAR_BIT);printf("MIN-MAX RANGE OF sign…
//WHAT WILL BE PRINTED WHEN INT VALUE IS PRINTED IN THE FORM OF %f //#includeint main(){int i=12;printf("%f",i);//what will it print????return 0;}//OUTPUT://56656092552878981120.00000
/*PROG--TO SHOW DIFFRENCE BETWEEN 2 VALUES WHEN 1 IS FLOAT VARIABLE & OTHER IS 2.5 VALUE CONSTANT*/#includeint main(){float i=2.5;if(i == 2.5)printf("same\n");//will print the same..mea…
//HOW UNPACKED BCD VALUE IS PRINTED...& HEX..#includeint main(){int i=010;//u can say it unpaked BCD NO...//treat this as decimal ..convert it into hex...& print that hex value in decimal typ…
/*PROG--TO COUNT NO. OF CHARACTERS IN PRINTF*/#includeint main(){int k;k=printf("HELLO\n");printf("k=%d\n",k);//it will be 6 ..one character NULL '\0' will also be count…
/*AN IMPLEMENTATION TO REVERSE A NO.*/#includeint main(){int num=0,r=0;printf("ENTER THE NO: TO REVERSE\n");//suppose no. is 4576//enter the no. to reversescanf("%d",&num);//A…
/*PROG--TO PRINT \ & '' IN PRINTF*/#includeint main(){printf("\n%s","\EMBLOGIC\n");//..\E will not allow .M TO print..//printf("\\emblogic\n");//\\ WILL …
i am using the fedora 15 through the virtual box in the my Windows 8 operating system i want to open one of my file in my window operating system which i made in virtual box but i didn't find th…
/*PROG--TO ADD N NOS.*/#include#includeint main(){int sum=0,i=0;char *choice;choice=malloc(4);//it will provide memory to pointer initially 4 byteprintf("DO U WANT TO ADD?\n");scanf("%…
/*A PROGRAM OF C TO PRINT THE ELEMENTS DIRECTLY IN PRINTF WITH DIFFRENT TYPES WITHOUT USING ANY PRIMARY DATA TYPE*/#includeint main(){printf("%s\n","anu");//THIS WILL PRINT anupr…
/*PROG--PRINT THE AREA OF SQUARE*/#includeint main(){int a;printf("ENTER THE SIDE OF SQUARE\n");scanf("%d",&a);printf("area of square is=%d\n",a*a);return 0;}