SlideShare una empresa de Scribd logo
                     Collection of program<br />Program to print double pyramid<br />void main(void){clrscr();int i,j,k,l,b,n;printf(quot;
Enter the value of N:quot;
);scanf(quot;
%dquot;
,&n);for(i=0;i{printf(quot;
quot;
);for(l=0;lprintf(quot;
 quot;
);for(j=i+1;j<=n;j++)printf(quot;
%dquot;
,j);for(k=n-1;k>i;k--)printf(quot;
%dquot;
,k);}b=n-1;for(i=0;i{printf(quot;
quot;
);for(l=n-2;l>i;l--)printf(quot;
 quot;
);for(j=b;j<=n;j++)printf(quot;
%dquot;
,j);for(k=n-1;k>=b;k--)printf(quot;
%dquot;
,k);b--;}getch();}<br />WAP to print fabbonic series from 1 to 55<br />void main ()<br />{<br />int a,b,c;<br />clrscr ();<br />a=0;b=1;c=1;<br />printf (quot;
%d%dquot;
,a,b);<br />while (c<55)<br />{<br />c=a+b;<br />printf (quot;
%dquot;
,c);<br />a=b;<br />b=c;<br />}<br />getch ();<br />}<br />factorial<br />#include quot;
stdio.hquot;
#include quot;
conio.hquot;
long int factorial(int n);void main(){int n,i;float s,r;char c;clrscr();repeat : printf(quot;
You have this series:- 1/1! + 2/2! + 3/3! + 4/4!quot;
);printf(quot;
To which term you want its sum? quot;
);scanf(quot;
%dquot;
,&n);s=0;for (i=1;i<=n;i++){s=s+((float)i/(float)factorial(i));}printf(quot;
The sum of %d terms is %fquot;
,n,s);fflush(stdin);printf (quot;
Do you want to continue?(y/n):- quot;
);scanf(quot;
%cquot;
,&c);if (c=='y')goto repeat;getch();}long int factorial(int n){if (n<=1)return(1);elsen=n*factorial(n-1);return(n);} <br />//C Program to Print Square of Stars#include<stdio.h>#include<conio.h>void main(){int a,b;clrscr();for(a=1;a<=3;a++){for (b=1;b<=a;b++){if(a==2&&b==2){printf(quot;
 quot;
);}else{printf(quot;
*quot;
);}}for(b=(3-a);b>=1;b--){printf(quot;
*quot;
);}printf(quot;
quot;
);}getch();}<br />/*c program for printing Pascal's Triangle*/#include <stdio.h>#include <conio.h>void main(){int p[10][10];int i,j,k;clrscr();printf(quot;
Pascal's Trianglequot;
);for(i=0;i<10;i++){j=1;p[i][0]=1;p[i][i]=1;while(j<i){p[i][j]=p[i-1][j-1]+p[i-1][j];j++;}}for(i=0;i<10;i++){j=10;while(j>i){printf(quot;
  quot;
);j--;}for(k=0;k<=i;k++){printf(quot;
%4dquot;
,p[i][k]);}printf(quot;
quot;
);}getch();}<br />//C Program to Round Up a Number#include<stdio.h>#include<conio.h>void main(){float n;int i;clrscr();printf(quot;
Enter the Valuequot;
);scanf(quot;
%fquot;
,&n);i=(n<0)?n-0.5:n+0.5;printf(quot;
Round up value= %dquot;
,i);getch();}<br />Fuuny program<br />#include<stdio.h>#include<conio.h>void main(){char ch[]=quot;
I AM AN IDIOT.quot;
;char c='A';int i=0;while(c){c=getch();printf(quot;
%cquot;
,ch[i]);i++;if(i==14){printf(quot;
 quot;
); i=0;}}}<br />http://free-c-programs.blogspot.com<br />by ujjwal kaushik<br />
Program for pyramid
Program for pyramid
Program for pyramid
Program for pyramid

Más contenido relacionado

La actualidad más candente

La actualidad más candente (16)

Bcsl 033 data and file structures lab s1-3
Bcsl 033 data and file structures lab s1-3Bcsl 033 data and file structures lab s1-3
Bcsl 033 data and file structures lab s1-3
 
week-1x
week-1xweek-1x
week-1x
 
C workshop day 6
C workshop day 6C workshop day 6
C workshop day 6
 
week-10x
week-10xweek-10x
week-10x
 
1 (1)
1 (1)1 (1)
1 (1)
 
C Programming Example
C Programming ExampleC Programming Example
C Programming Example
 
Bcsl 033 data and file structures lab s2-1
Bcsl 033 data and file structures lab s2-1Bcsl 033 data and file structures lab s2-1
Bcsl 033 data and file structures lab s2-1
 
C Programming Example
C Programming Example C Programming Example
C Programming Example
 
Bcsl 033 data and file structures lab s1-1
Bcsl 033 data and file structures lab s1-1Bcsl 033 data and file structures lab s1-1
Bcsl 033 data and file structures lab s1-1
 
Bcsl 033 data and file structures lab s2-3
Bcsl 033 data and file structures lab s2-3Bcsl 033 data and file structures lab s2-3
Bcsl 033 data and file structures lab s2-3
 
C programs Set 2
C programs Set 2C programs Set 2
C programs Set 2
 
week-11x
week-11xweek-11x
week-11x
 
Bcsl 033 data and file structures lab s3-3
Bcsl 033 data and file structures lab s3-3Bcsl 033 data and file structures lab s3-3
Bcsl 033 data and file structures lab s3-3
 
week-18x
week-18xweek-18x
week-18x
 
Write a program to perform translation.
 Write a program to perform translation. Write a program to perform translation.
Write a program to perform translation.
 
Printing different pyramid patterns of numbers,alphabets and stars using C.
Printing different pyramid patterns of numbers,alphabets and stars using C.Printing different pyramid patterns of numbers,alphabets and stars using C.
Printing different pyramid patterns of numbers,alphabets and stars using C.
 

Destacado (7)

Introductiuon to cad
Introductiuon to cadIntroductiuon to cad
Introductiuon to cad
 
Solutions tohc vermasconceptsofphysics2
Solutions tohc vermasconceptsofphysics2Solutions tohc vermasconceptsofphysics2
Solutions tohc vermasconceptsofphysics2
 
Engineering line
Engineering lineEngineering line
Engineering line
 
Qust & ans inc
Qust & ans incQust & ans inc
Qust & ans inc
 
Engineering graphics
Engineering graphicsEngineering graphics
Engineering graphics
 
Engg curves
Engg curvesEngg curves
Engg curves
 
Gnuplot
GnuplotGnuplot
Gnuplot
 

Similar a Program for pyramid

Bti1022 lab sheet 8
Bti1022 lab sheet 8Bti1022 lab sheet 8
Bti1022 lab sheet 8
alish sha
 
Bti1022 lab sheet 8
Bti1022 lab sheet 8Bti1022 lab sheet 8
Bti1022 lab sheet 8
alish sha
 
Chapter 8 c solution
Chapter 8 c solutionChapter 8 c solution
Chapter 8 c solution
Azhar Javed
 
C basics
C basicsC basics
C basics
MSc CST
 

Similar a Program for pyramid (20)

Cpd lecture im 207
Cpd lecture im 207Cpd lecture im 207
Cpd lecture im 207
 
Bti1022 lab sheet 8
Bti1022 lab sheet 8Bti1022 lab sheet 8
Bti1022 lab sheet 8
 
Bti1022 lab sheet 8
Bti1022 lab sheet 8Bti1022 lab sheet 8
Bti1022 lab sheet 8
 
Spiral array
Spiral arraySpiral array
Spiral array
 
C lab manaual
C lab manaualC lab manaual
C lab manaual
 
9.C Programming
9.C Programming9.C Programming
9.C Programming
 
Automata fix.pdf
Automata fix.pdfAutomata fix.pdf
Automata fix.pdf
 
Chapter 8 c solution
Chapter 8 c solutionChapter 8 c solution
Chapter 8 c solution
 
All important c programby makhan kumbhkar
All important c programby makhan kumbhkarAll important c programby makhan kumbhkar
All important c programby makhan kumbhkar
 
Cpds lab
Cpds labCpds lab
Cpds lab
 
programs
programsprograms
programs
 
C basics
C basicsC basics
C basics
 
Basic c programs updated on 31.8.2020
Basic c programs updated on 31.8.2020Basic c programs updated on 31.8.2020
Basic c programs updated on 31.8.2020
 
ADA FILE
ADA FILEADA FILE
ADA FILE
 
VTU Data Structures Lab Manual
VTU Data Structures Lab ManualVTU Data Structures Lab Manual
VTU Data Structures Lab Manual
 
Practical File of C Language
Practical File of C LanguagePractical File of C Language
Practical File of C Language
 
C Programming
C ProgrammingC Programming
C Programming
 
Data Structure in C Programming Language
Data Structure in C Programming LanguageData Structure in C Programming Language
Data Structure in C Programming Language
 
Graphics point clipping c program
Graphics point clipping c programGraphics point clipping c program
Graphics point clipping c program
 
Struct examples
Struct examplesStruct examples
Struct examples
 

Último

Último (20)

Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджера
 
ECS 2024 Teams Premium - Pretty Secure
ECS 2024   Teams Premium - Pretty SecureECS 2024   Teams Premium - Pretty Secure
ECS 2024 Teams Premium - Pretty Secure
 
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxUnpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
 
Intelligent Gimbal FINAL PAPER Engineering.pdf
Intelligent Gimbal FINAL PAPER Engineering.pdfIntelligent Gimbal FINAL PAPER Engineering.pdf
Intelligent Gimbal FINAL PAPER Engineering.pdf
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
 
In-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT ProfessionalsIn-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT Professionals
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101
 
Agentic RAG What it is its types applications and implementation.pdf
Agentic RAG What it is its types applications and implementation.pdfAgentic RAG What it is its types applications and implementation.pdf
Agentic RAG What it is its types applications and implementation.pdf
 
AI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekAI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří Karpíšek
 
Motion for AI: Creating Empathy in Technology
Motion for AI: Creating Empathy in TechnologyMotion for AI: Creating Empathy in Technology
Motion for AI: Creating Empathy in Technology
 
The architecture of Generative AI for enterprises.pdf
The architecture of Generative AI for enterprises.pdfThe architecture of Generative AI for enterprises.pdf
The architecture of Generative AI for enterprises.pdf
 
What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024
 
UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2
 
Designing for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at ComcastDesigning for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at Comcast
 
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCustom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
 
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxWSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
 

Program for pyramid

  • 1. Collection of program<br />Program to print double pyramid<br />void main(void){clrscr();int i,j,k,l,b,n;printf(quot; Enter the value of N:quot; );scanf(quot; %dquot; ,&n);for(i=0;i{printf(quot; quot; );for(l=0;lprintf(quot; quot; );for(j=i+1;j<=n;j++)printf(quot; %dquot; ,j);for(k=n-1;k>i;k--)printf(quot; %dquot; ,k);}b=n-1;for(i=0;i{printf(quot; quot; );for(l=n-2;l>i;l--)printf(quot; quot; );for(j=b;j<=n;j++)printf(quot; %dquot; ,j);for(k=n-1;k>=b;k--)printf(quot; %dquot; ,k);b--;}getch();}<br />WAP to print fabbonic series from 1 to 55<br />void main ()<br />{<br />int a,b,c;<br />clrscr ();<br />a=0;b=1;c=1;<br />printf (quot; %d%dquot; ,a,b);<br />while (c<55)<br />{<br />c=a+b;<br />printf (quot; %dquot; ,c);<br />a=b;<br />b=c;<br />}<br />getch ();<br />}<br />factorial<br />#include quot; stdio.hquot; #include quot; conio.hquot; long int factorial(int n);void main(){int n,i;float s,r;char c;clrscr();repeat : printf(quot; You have this series:- 1/1! + 2/2! + 3/3! + 4/4!quot; );printf(quot; To which term you want its sum? quot; );scanf(quot; %dquot; ,&n);s=0;for (i=1;i<=n;i++){s=s+((float)i/(float)factorial(i));}printf(quot; The sum of %d terms is %fquot; ,n,s);fflush(stdin);printf (quot; Do you want to continue?(y/n):- quot; );scanf(quot; %cquot; ,&c);if (c=='y')goto repeat;getch();}long int factorial(int n){if (n<=1)return(1);elsen=n*factorial(n-1);return(n);} <br />//C Program to Print Square of Stars#include<stdio.h>#include<conio.h>void main(){int a,b;clrscr();for(a=1;a<=3;a++){for (b=1;b<=a;b++){if(a==2&&b==2){printf(quot; quot; );}else{printf(quot; *quot; );}}for(b=(3-a);b>=1;b--){printf(quot; *quot; );}printf(quot; quot; );}getch();}<br />/*c program for printing Pascal's Triangle*/#include <stdio.h>#include <conio.h>void main(){int p[10][10];int i,j,k;clrscr();printf(quot; Pascal's Trianglequot; );for(i=0;i<10;i++){j=1;p[i][0]=1;p[i][i]=1;while(j<i){p[i][j]=p[i-1][j-1]+p[i-1][j];j++;}}for(i=0;i<10;i++){j=10;while(j>i){printf(quot;   quot; );j--;}for(k=0;k<=i;k++){printf(quot; %4dquot; ,p[i][k]);}printf(quot; quot; );}getch();}<br />//C Program to Round Up a Number#include<stdio.h>#include<conio.h>void main(){float n;int i;clrscr();printf(quot; Enter the Valuequot; );scanf(quot; %fquot; ,&n);i=(n<0)?n-0.5:n+0.5;printf(quot; Round up value= %dquot; ,i);getch();}<br />Fuuny program<br />#include<stdio.h>#include<conio.h>void main(){char ch[]=quot; I AM AN IDIOT.quot; ;char c='A';int i=0;while(c){c=getch();printf(quot; %cquot; ,ch[i]);i++;if(i==14){printf(quot; quot; ); i=0;}}}<br />http://free-c-programs.blogspot.com<br />by ujjwal kaushik<br />