SlideShare ist ein Scribd-Unternehmen logo
1 von 5
                     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

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (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.
 

Andere mochten auch

Introductiuon to cad
Introductiuon to cadIntroductiuon to cad
Introductiuon to cadnayakq
 
Solutions tohc vermasconceptsofphysics2
Solutions tohc vermasconceptsofphysics2Solutions tohc vermasconceptsofphysics2
Solutions tohc vermasconceptsofphysics2nayakq
 
Engineering line
Engineering lineEngineering line
Engineering lineStudent
 
Qust & ans inc
Qust & ans incQust & ans inc
Qust & ans incnayakq
 
Engineering graphics
Engineering graphicsEngineering graphics
Engineering graphicsStudent
 
Gnuplot
GnuplotGnuplot
Gnuplotdklajd
 

Andere mochten auch (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
 

Ähnlich wie Program for pyramid

Ähnlich wie 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
 

Kürzlich hochgeladen

TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 

Kürzlich hochgeladen (20)

TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 

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 />