SlideShare une entreprise 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

Contenu connexe

Tendances

Tendances (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.
 

En vedette (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
 

Similaire à 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
 

Similaire à 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
 

Dernier

Dernier (20)

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
 
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
 
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
 
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
 
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
 
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxWSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
 
ECS 2024 Teams Premium - Pretty Secure
ECS 2024   Teams Premium - Pretty SecureECS 2024   Teams Premium - Pretty Secure
ECS 2024 Teams Premium - Pretty Secure
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
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)
 
Transforming The New York Times: Empowering Evolution through UX
Transforming The New York Times: Empowering Evolution through UXTransforming The New York Times: Empowering Evolution through UX
Transforming The New York Times: Empowering Evolution through UX
 
Enterprise Security Monitoring, And Log Management.
Enterprise Security Monitoring, And Log Management.Enterprise Security Monitoring, And Log Management.
Enterprise Security Monitoring, And Log Management.
 
Speed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in MinutesSpeed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in Minutes
 
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
 
Intelligent Gimbal FINAL PAPER Engineering.pdf
Intelligent Gimbal FINAL PAPER Engineering.pdfIntelligent Gimbal FINAL PAPER Engineering.pdf
Intelligent Gimbal FINAL PAPER Engineering.pdf
 
Strategic AI Integration in Engineering Teams
Strategic AI Integration in Engineering TeamsStrategic AI Integration in Engineering Teams
Strategic AI Integration in Engineering Teams
 
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
 
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
 
Powerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaPowerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara Laskowska
 
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
 
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
 

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