हिंदी माध्यम नोट्स
Pattern or Pyramid Programe in c computer language in hindi पैटर्न c कोड को समझाइये हिंदी में
बाद मे ,दिए गये solutions को समझे |
Pattern 1.
*
**
***
****
*****
Pattern 2.
******
*****
****
***
**
*
Pattern 3.
*
***
*****
*******
*********
***********
Pattern 4.
1
2 3
4 5 6
7 8 9 10Pattern 5.
*********
*******
*****
***
*
Pattern 6.
1
1 2
1 2 3
1 2 3 4
Solution for Pattern -1
इस pattern मे दो for loops को nested करना पड़ेगा |जिसमे inner loop मे j<=iकी condition check होगी क्योकि पहली line मे एक ही ‘ * ‘ print होगा |
जब i=0,तब j<=0 के लिए * एक बार print होगा |
फिर i=1,तब j=0,1 के लिए *दो बार print होगा |
फिर i=2,तब j=0,1,2 के लिए * तीन बार print होगा |
फिर i=3,तब j=0,1,2,3 के लिए * चार बार print होगा |
फिर i=4,तब j=0,1,2,3,4 के लिए * पांच बार print होगा |
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j ;
for(i=0;i<5;i++)
{
for(j=0;j<=i;j++)
{
ptrintf(“*”);
}
printf(“\n”);
}
getch();
}
Solution For Pattern 2:
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j ;
for(i=5;i>0;i–)
{
for(j=0;j<=i;j++)
{
ptrintf(“*”);
}
printf(“\n”);
}
getch();
}
solution for Pattern 3:
इस article मे हम कुछ basic और advance Pattern or Pyramid Questions है जिसे आप पहले खुद try करे|
बाद मे ,दिए गये solutions को समझे |
Pattern 1.
*
**
***
****
*****
Pattern 2.
******
*****
****
***
**
*
Pattern 3.
*
***
*****
*******
*********
***********
Pattern 4.
1
2 3
4 5 6
7 8 9 10
Pattern 5.
*********
*******
*****
***
*
Pattern 6.
1
1 2
1 2 3
1 2 3 4
Solution for Pattern -1
इस pattern मे दो for loops को nested करना पड़ेगा |जिसमे inner loop मे j<=iकी condition check होगी क्योकि पहली line मे एक ही ‘ * ‘ print होगा |
जब i=0,तब j<=0 के लिए * एक बार print होगा |
फिर i=1,तब j=0,1 के लिए *दो बार print होगा |
फिर i=2,तब j=0,1,2 के लिए * तीन बार print होगा |
फिर i=3,तब j=0,1,2,3 के लिए * चार बार print होगा |
फिर i=4,तब j=0,1,2,3,4 के लिए * पांच बार print होगा |
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j ;
for(i=0;i<5;i++)
{
for(j=0;j<=i;j++)
{
ptrintf(“*”);
}
printf(“\n”);
}
getch();
}
Solution For Pattern 2:
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j ;
for(i=5;i>0;i–)
{
for(j=0;j<=i;j++)
{
ptrintf(“*”);
}
printf(“\n”);
}
getch();
}
solution for Pattern 3:
इस article मे हम कुछ basic और advance Pattern or Pyramid Questions है जिसे आप पहले खुद try करे|
बाद मे ,दिए गये solutions को समझे |
Pattern 1.
*
**
***
****
*****
Pattern 2.
******
*****
****
***
**
*
Pattern 3.
*
***
*****
*******
*********
***********
Pattern 4.
1
2 3
4 5 6
7 8 9 10
Pattern 5.
*********
*******
*****
***
*
Pattern 6.
1
1 2
1 2 3
1 2 3 4
Solution for Pattern -1
इस pattern मे दो for loops को nested करना पड़ेगा |जिसमे inner loop मे j<=iकी condition check होगी क्योकि पहली line मे एक ही ‘ * ‘ print होगा |
जब i=0,तब j<=0 के लिए * एक बार print होगा |
फिर i=1,तब j=0,1 के लिए *दो बार print होगा |
फिर i=2,तब j=0,1,2 के लिए * तीन बार print होगा |
फिर i=3,तब j=0,1,2,3 के लिए * चार बार print होगा |
फिर i=4,तब j=0,1,2,3,4 के लिए * पांच बार print होगा |
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j ;
for(i=0;i<5;i++)
{
for(j=0;j<=i;j++)
{
ptrintf(“*”);
}
printf(“\n”);
}
getch();
}
Solution For Pattern 2:
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j ;
for(i=5;i>0;i–)
{
for(j=0;j<=i;j++)
{
ptrintf(“*”);
}
printf(“\n”);
}
getch();
}
solution for Pattern 3:
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,k,m;
for(i=0;i<=8;i++)
{
for(j=8;j>=i;j–)
{
printf(” “);
}
for(k=1;k<=m;i++)
{
printf(“*”);
}
}
m=m+2;
printf(“\n”);
}
getch();
}
Solution of Pattern 4:
#include<conio.h>
#include<stdio.h>
void main()
{
int i,j;
int num=1;
for(i=1;i<=5;i++)
{
for(j=1;j<=i;j++)
{
printf(“%d”,num);
++num;
}
}
getch();
}
Solution for pattern 5
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,k;
int m=8;
for(i=0;i<=8;i++)
{
for(j=1;j>=i;j++)
{
printf(” “);
}
for(j=1;k<=(m*2-(2*i-1));i++)
{
printf(“*”);
}
printf(“\n”);
}
getch();
}
Solution for pattern 6:
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
for(i=1;i<=5;i++)
{
for(j=1;j<=i;j++)
{
printf(“%d”,j);
}
printf(“\n”);
}
getch();
}
Recent Posts
Question Tag Definition in english with examples upsc ssc ias state pcs exames important topic
Question Tag Definition • A question tag is a small question at the end of a…
Translation in english grammer in hindi examples Step of Translation (अनुवाद के चरण)
Translation 1. Step of Translation (अनुवाद के चरण) • मूल वाक्य का पता करना और उसकी…
Report Writing examples in english grammer How to Write Reports explain Exercise
Report Writing • How to Write Reports • Just as no definite rules can be laid down…
Letter writing ,types and their examples in english grammer upsc state pcs class 12 10th
Letter writing • Introduction • Letter writing is an intricate task as it demands meticulous attention, still…
विश्व के महाद्वीप की भौगोलिक विशेषताएँ continents of the world and their countries in hindi features
continents of the world and their countries in hindi features विश्व के महाद्वीप की भौगोलिक…
भारत के वन्य जीव राष्ट्रीय उद्यान list in hin hindi IAS UPSC
भारत के वन्य जीव भारत में जलवायु की दृष्टि से काफी विविधता पाई जाती है,…