JOIN us on
WhatsApp Group Join Now
Telegram Join Join Now

हिंदी माध्यम नोट्स

Class 6

Hindi social science science maths English

Class 7

Hindi social science science maths English

Class 8

Hindi social science science maths English

Class 9

Hindi social science science Maths English

Class 10

Hindi Social science science Maths English

Class 11

Hindi sociology physics physical education maths english economics geography History

chemistry business studies biology accountancy political science

Class 12

Hindi physics physical education maths english economics

chemistry business studies biology accountancy Political science History sociology

Home science Geography

English medium Notes

Class 6

Hindi social science science maths English

Class 7

Hindi social science science maths English

Class 8

Hindi social science science maths English

Class 9

Hindi social science science Maths English

Class 10

Hindi Social science science Maths English

Class 11

Hindi physics physical education maths entrepreneurship english economics

chemistry business studies biology accountancy

Class 12

Hindi physics physical education maths entrepreneurship english economics

chemistry business studies biology accountancy

Categories: C Language in hindi

Triangle Pattern – Part 2 in c language in hindi , Triangle Pattern examples in c programming in hindi

Triangle Pattern examples in c programming in hindi , Triangle Pattern – Part 2 in c language in hindi :-
इससे पहले के article मे , हमने triangle पैटर्न के 10 उदाहरण को पढ़ा |अब इस article मे triangle पैटर्न के मुश्किल पैटर्न को पढ़गे |
उदहारण -1 :
Write a program to print below pattern.
1
00
111
0000
11111
Explanation
1.सबसे पहले यूजर से row और column की number को input करा लेते है |
2.फिर उसके बाद दो variable i और j को declare कर लेते है |
3.Loop 1 चलाया जाता है जिसमे i को 1 से initial किया जाता है|\
अगर i की value सम होती है तब
inner loop मे , ‘0’ को print किया जाता है |
और अगर i की value विषम होती है तब |
inner loop मे ,’1′ को print किया जाता है |
4. loop 1 तब तक चलेगा जब तक i की वाले row तक नहीं होती है |Source code

#include<stdio.h>
#include<conio.h>
void main()
{
int i,j ;
int c,r;
printf(“Enter Row Number”);
scnaf(“%d”,&r);
printf(“Enter Column Number “);
scnaf(“%d”,&c);
for(i=1;i<=r;i++)
{
if((i%2)==0)
{
for(j=1;j<=i,j++)
{
printf(“0”);
}
}
else
{
for(j=1;j<=i,j++)
{
printf(“1”);
}
}
printf(“\n”);
}
getch();
}
आउटपुट होगा :
Enter Row Number 4
Enter Column Number 4
1
00
111
0000
उदहारण -2 :
Write a program to print below pattern.
1
11
101
1001
11111
Explanation
जब इस पैटर्न को observe किया जाता है तब पता चलता है :-
first और last row के सभी element ‘1’ है |
और first और last column के सभी element ‘1’ है |
और बाकि position के लिए ‘0’ होगी |
1.सबसे पहले यूजर से row और column की number को input करा लेते है |
2.फिर उसके बाद दो variable i और j को declare कर लेते है |
3.Loop 1 चलाया जाता है जिसमे i को 1 से initial किया जाता है|
inner loop 2 मे ,
जब (i==1)||(i==r)||(j==1)||(j==c) की condition true होगी तब ‘1’ print होगा
अन्यथा ‘0’ print होगा |
4. loop 1 तब तक चलेगा जब तक i की वाले row तक नहीं होती है |Source code

#include<stdio.h>
#include<conio.h>
void main()
{
int i,j ;
int c,r;
printf(“Enter Row Number”);
scnaf(“%d”,&r);
printf(“Enter Column Number “);
scnaf(“%d”,&c);
for(i=1;i<=r;i++)
{
for(j=1;j<=i,j++)
{
if((i==1)||(i==r)||(j==1)||(j==c) )
{
printf(“1”);
}
else
{
printf(“0”);
}
}
printf(“\n”);
}
getch();
}
आउटपुट होगा :
Enter Row Number 4
Enter Column Number 4
1
11
101
1111
उदहारण -3 :
Write a program to print below pattern.
0
11
000
1111
00000
Explanation
1.सबसे पहले यूजर से row और column की number को input करा लेते है |
2.फिर उसके बाद दो variable i और j को declare कर लेते है |
3.Loop 1 चलाया जाता है जिसमे i को 1 से initial किया जाता है |
अगर i की value सम होती है तब  inner loop मे , ‘1’ को print किया जाता है |
और अगर i की value विषम होती है तब inner loop मे ,’0′ को print किया जाता है |
4. loop 1 तब तक चलेगा जब तक i की वाले row तक नहीं होती है |Source code

#include<stdio.h>
#include<conio.h>
void main()
{
int i,j ;
int c,r;
printf(“Enter Row Number”);
scnaf(“%d”,&r);
printf(“Enter Column Number “);
scnaf(“%d”,&c);
for(i=1;i<=r;i++)
{
if((i%2)==0)
{
for(j=1;j<=i,j++)
{
printf(“1”);
}
}
else
{
for(j=1;j<=i,j++)
{
printf(“0”);
}
}
printf(“\n”);
}
getch();
}
आउटपुट होगा :
Enter Row Number 4
Enter Column Number 4
0
11
000
1111
उदहारण -4 :
Write a program to print below pattern.
1
123
12345
1234567
Explanation
1.सबसे पहले यूजर से row और column की number को input करा लेते है |
2.फिर उसके बाद दो variable i और j को declare कर लेते है |
3.Loop 1 चलाया जाता है जिसमे i को 1 से initial किया जाता है |
inner loop मे , j की value ‘1’ से initial करते है |
body मे , ‘j’ की value को print करते है |
inner loop तब तक चलेगा जब तक j की value i*2-1 से कम या सामान नहीं हो जाती है |
4. loop 1 तब तक चलेगा जब तक i की वाले row तक नहीं होती है |Source code

#include<stdio.h>
#include<conio.h>
void main()
{
int i,j ;
int c,r;
printf(“Enter Row Number”);
scnaf(“%d”,&r);
printf(“Enter Column Number “);
scnaf(“%d”,&c);
for(i=1;i<=r;i++)
{
for(j=1;j<=(2*i-1);j++)
{
printf(“%d”,j);
}
printf(“\n”);
}
getch();
}
आउटपुट होगा :
Enter Row Number 4
Enter Column Number 4
1
123
12345
1234567
उदहारण -5 :
Write a program to print below pattern.
1
24
135
2468
13579
Explanation
1.सबसे पहले यूजर से row और column की number को input करा लेते है |
2.फिर उसके बाद दो variable i और j को declare कर लेते है | इसके अलावा variable ‘v ‘ को भी declare करेगे |
3.Loop 1 चलाया जाता है जिसमे i को 1 से initial किया जाता है |
अगर ‘i’ की value even है तब ‘v’ की value ‘1’ से initial होगी |अन्यथा ‘v’ की value 2 से initial होगी |फिर inner loop perform होगा
inner loop मे , j की value ‘1’ से initial करते है |
body मे , ‘j’ की value को print करते है | और v की value ‘2’ से increment होगी |
inner loop तब तक चलेगा जब तक j की value i से कम या सामान नहीं हो जाती है |
4. loop 1 तब तक चलेगा जब तक i की वाले row तक नहीं होती है |Source code

#include<stdio.h>
#include<conio.h>
void main()
{
int i,j ;
int c,r;
printf(“Enter Row Number”);
scnaf(“%d”,&r);
printf(“Enter Column Number “);
scnaf(“%d”,&c);
int v;
for(i=1;i<=r;i++)
{
if( v %2==0)
{
v=2;
}
else
{
v=1;
}
for(j=1;j<=i;j++)
{
printf(“%d”,v);
v=v+2;
}
printf(“\n”);
}
getch();
}
आउटपुट होगा :
Enter Row Number 5
Enter Column Number 5
1
24
135
2468
13579
उदहारण -6 :
Write a program to print below pattern.
1
      123
  12345
1234567
Explanation
1.सबसे पहले यूजर से row और column की number को input करा लेते है |
2.फिर उसके बाद दो variable i और j को declare कर लेते है |
3.Loop 1 चलाया जाता है जिसमे i को 1 से initial किया जाता है | इस loop मे दो inner loop चलेगे|
पहले inner loop मे , space को print किया जाता है |
inner loop मे , j की value ‘1’ से initial करते है |
body मे , ‘j’ की value को print करते है |
inner loop तब तक चलेगा जब तक j की value i*2-1 से कम या सामान नहीं हो जाती है |
4. loop 1 तब तक चलेगा जब तक i की वाले row तक नहीं होती है |Source code

#include<stdio.h>
#include<conio.h>
void main()
{
int i,j ;
int c,r;
printf(“Enter Row Number”);
scnaf(“%d”,&r);
printf(“Enter Column Number “);
scnaf(“%d”,&c);
for(i=1;i<=r;i++)
{
for(i=1;i<(r-i)*2;i++)
{
printf(” “);
}
for(j=1;j<=(2*i-1);j++)
{
printf(“%d”,j);
}
printf(“\n”);
}
getch();
}
आउटपुट होगा :
Enter Row Number 4
Enter Column Number 4
          1
      123
  12345
1234567
Sbistudy

Recent Posts

द्वितीय कोटि के अवकल समीकरण तथा विशिष्ट फलन क्या हैं differential equations of second order and special functions in hindi

अध्याय - द्वितीय कोटि के अवकल समीकरण तथा विशिष्ट फलन (Differential Equations of Second Order…

5 hours ago

four potential in hindi 4-potential electrodynamics चतुर्विम विभव किसे कहते हैं

चतुर्विम विभव (Four-Potential) हम जानते हैं कि एक निर्देश तंत्र में विद्युत क्षेत्र इसके सापेक्ष…

3 days ago

Relativistic Electrodynamics in hindi आपेक्षिकीय विद्युतगतिकी नोट्स क्या है परिभाषा

आपेक्षिकीय विद्युतगतिकी नोट्स क्या है परिभाषा Relativistic Electrodynamics in hindi ? अध्याय : आपेक्षिकीय विद्युतगतिकी…

5 days ago

pair production in hindi formula definition युग्म उत्पादन किसे कहते हैं परिभाषा सूत्र क्या है लिखिए

युग्म उत्पादन किसे कहते हैं परिभाषा सूत्र क्या है लिखिए pair production in hindi formula…

1 week ago

THRESHOLD REACTION ENERGY in hindi देहली अभिक्रिया ऊर्जा किसे कहते हैं सूत्र क्या है परिभाषा

देहली अभिक्रिया ऊर्जा किसे कहते हैं सूत्र क्या है परिभाषा THRESHOLD REACTION ENERGY in hindi…

1 week ago
All Rights ReservedView Non-AMP Version
X

Headline

You can control the ways in which we improve and personalize your experience. Please choose whether you wish to allow the following:

Privacy Settings
JOIN us on
WhatsApp Group Join Now
Telegram Join Join Now