You are on page 1of 150

Programming in C

Adeel Shabbir

Adeel Shabbir

Programming in C CASE

Adeel Shabbir

Programming in C CASE

Adeel Shabbir

Programming in C CASE

Adeel Shabbir

Programming in C CASE

Adeel Shabbir

Programming in C CASE

For Loop

Adeel Shabbir

Programming in C CASE

Adeel Shabbir

Programming in C CASE

Print your name 1 time

Adeel Shabbir

Programming in C CASE

printf(adeel);

Adeel Shabbir

Programming in C CASE

10

Print your name 5 times

Adeel Shabbir

Programming in C CASE

11

printf(adeel); printf(adeel); printf(adeel); printf(adeel); printf(adeel);

Adeel Shabbir

Programming in C CASE

12

Print your name 15 times

Adeel Shabbir

Programming in C CASE

13

printf(adeel); printf(adeel); printf(adeel); printf(adeel); printf(adeel); printf(adeel); printf(adeel); printf(adeel); printf(adeel); printf(adeel); printf(adeel); printf(adeel); printf(adeel); printf(adeel); printf(adeel);

Adeel Shabbir

Programming in C CASE

14

Print your name 1000 times

Adeel Shabbir

Programming in C CASE

15

???????????????????????????????????????? ???????????????????????????????????????? ???????????????????????????????????????? ???????????????????????????????????????? ??????????????????????????????

Adeel Shabbir

Programming in C CASE

16

Repeat a task for some number of times

Adeel Shabbir

Programming in C CASE

17

Loop is a control structure that repeats a group of steps in a program.


Loop body stands for the repeated statements.

Adeel Shabbir

Programming in C CASE

18

The for Statement in C


The syntax of for statement in C: for (initialization expression; loop repetition condition; update expression) statement The initialization expression set the initial value of the loop control variable. The loop repetition condition test the value of the loop control variable. The update expression update the loop control Copyright 2004 Pearson variable. Addison-Wesley. All rights 5-19
reserved.

Start

ody

Initialization

Condition

F Stop T Body of loop Inc/Dec


Adeel Shabbir Programming in C CASE 20

Start

ody

i=1

I<=5
T Body of loop i=i+1
Adeel Shabbir

F Stop

Programming in C CASE

21

Start

ody

i=1

I<=10
T Body of loop i=i+1
Adeel Shabbir

F Stop

Programming in C CASE

22

Start

ody

i=1

I<=20
T Body of loop i=i+1
Adeel Shabbir

F Stop

Programming in C CASE

23

Adeel Shabbir

Programming in C CASE

24

Adeel Shabbir

Programming in C CASE

25

Syntax of for Statement


for (initialization expression;loop repetition condition;update expression)

statement Example: /* Display N asterisks */


for (count_star = 0; count_star <N; count_star += 1) printf(*);

5-26

void main() { int a;


for(a=1;a<=5;a=a+1) { printf("\nAdeel); }

}
Adeel Shabbir Programming in C CASE

27

void main() { int a;


for(a=1;a<=15;a=a+1) { printf("\nAdeel); }

}
Adeel Shabbir Programming in C CASE

28

void main() { int a;


for(a=1;a<=1000;a=a+1) { printf("\nAdeel); }

}
Adeel Shabbir Programming in C CASE

29

Print numbers

Adeel Shabbir

Programming in C CASE

30

void main() { int a;


for(a=1;a<=5;a=a+1) { printf("\n%d",a); }

}
Adeel Shabbir Programming in C CASE

31

void main() { int a;


for(a=1;a<=10;a=a+1) { printf("\n%d",a); }

}
Adeel Shabbir Programming in C CASE

32

void main() { int a;


for(a=1;a<=10;a=a+2) { printf("\n%d",a); }

}
Adeel Shabbir Programming in C CASE

33

void main() { int a;


for(a=1;a<5;a=a+1) { printf("\n%d",a); }

}
Adeel Shabbir Programming in C CASE

34

void main() { int a;


for(a=1;a<=5;a=a-1) { printf("\n%d",a); }

}
Adeel Shabbir Programming in C CASE

35

void main() { int a;


for(a=1;a<=5;) { printf("\n%d",a); }

}
Adeel Shabbir Programming in C CASE

36

void main() { int a;


for(a=1;;a=a+1) { printf("\n%d",a); }

}
Adeel Shabbir Programming in C CASE

37

void main() { int a;


for(a=1;5;a=a+1) { printf("\n%d",a); }

}
Adeel Shabbir Programming in C CASE

38

void main() { int a;


for(a=1;0;a=a+1) { printf("\n%d",a); }

}
Adeel Shabbir Programming in C CASE

39

void main() { int a=1;


for(;a<=5;a=a+1) { printf("\n%d",a); }

}
Adeel Shabbir Programming in C CASE

40

void main() { int a=1;


for(;;a=a+1) { printf("\n%d",a); }

}
Adeel Shabbir Programming in C CASE

41

void main() { int a=1;


for(;;) { printf("\n%d",a); }

}
Adeel Shabbir Programming in C CASE

42

void main() { int a;


for(a=1;a>5;a=a+1) { printf("\n%d",a); }

}
Adeel Shabbir Programming in C CASE

43

void main() { int a;


for(a=1;a<=5;a=a+1) { printf("\n%d",a+1); }

}
Adeel Shabbir Programming in C CASE

44

void main() { int a;


for(a=1;a<=5;a=a+1) { printf("\nAdeel); }

}
Adeel Shabbir Programming in C CASE

45

void main() { int a;


for(a=1;a<=5;a=a+1); { printf("\nAdeel); }

}
Adeel Shabbir Programming in C CASE

46

void main() { int a;


for(a=1;a<=5;a=a+1) { printf("\n%d Adeel,a); }

}
Adeel Shabbir Programming in C CASE

47

void main() { int a;


for(a=1;a<=5;a=a+1); { printf("\n%d Adeel,a); }

}
Adeel Shabbir Programming in C CASE

48

void main() { int a; a=2; for(a=1;a<=5;a=a+1) { printf("\n%d",a); a=a+1; } }


Adeel Shabbir Programming in C CASE 49

void main() { int a; a=2; for(a=1;a<=5;a=a+1) { printf("\n%d",a); a=a-2; } }


Adeel Shabbir Programming in C CASE 50

void main() { int a; a=2; for(a=1;a<=5;a+1) { printf("\n%d",a); } }


Adeel Shabbir Programming in C CASE

51

void main() { int a; a=2; for(a=5;a>=1;a=a-1) { printf("\n%d",a); } }


Adeel Shabbir Programming in C CASE

52

void main() { int a;


for(a=5;a>=1;a=a-2) { printf("\n%d",a); }

}
Adeel Shabbir Programming in C CASE

53

void main() { int a; a=2; for(a=5;a>1;a=a-1) { printf("\n%d",a-2); } }


Adeel Shabbir Programming in C CASE

54

void main() { int a; a=2; for(a=5;a>=1;a=a-1) { printf("\n%d",a); } }


Adeel Shabbir Programming in C CASE

55

void main() { int a; a=2; for(a=10;a>=1;a=a-1) { printf("\n%d",a); } }


Adeel Shabbir Programming in C CASE

56

void main() { int a,b,n; n=5; b=n%2; if(b==0) printf(%d is even,n); else printf(%d is od,n); }
Adeel Shabbir Programming in C CASE

57

void main() { int a,b,n; scanf(%d,&n); b=n%2; if(b==0) printf(%d is even,n); else printf(%d is od,n); }
Adeel Shabbir Programming in C CASE

58

void main() { int a,b,n; for(n=1;n<=5;n=n+1) { b=n%2; if(b==0) printf(%d is even,n); else printf(%d is od,n); } }
Adeel Shabbir Programming in C CASE 59

void main() { int a,b,n; for(n=1;n<=10;n=n+1) { b=n%2; if(b==0) printf(%d is even,n); else printf(%d is od,n); } }
Adeel Shabbir Programming in C CASE 60

void main() { int a,b,n; for(n=1;n<=20;n=n+1) { b=n%2; if(b==0) printf(%d is even,n); else printf(%d is od,n); } }
Adeel Shabbir Programming in C CASE 61

void main() { int a,b,n; m=5; for(n=1;n<=m;n=n+1) { b=n%2; if(b==0) printf(%d is even,n); else printf(%d is od,n); } }
Adeel Shabbir Programming in C CASE 62

void main() { int a,b,n; m=20; for(n=1;n<=m;n=n+1) { b=n%2; if(b==0) printf(%d is even,n); else printf(%d is od,n); } }
Adeel Shabbir Programming in C CASE 63

void main() { int a,b,n; scanf(%d,&m); for(n=1;n<=m;n=n+1) { b=n%2; if(b==0) printf(%d is even,n); else printf(%d is od,n); } }
Adeel Shabbir Programming in C CASE 64

void main() { int a,b,n; for(n=1;n<=10;n=n+1) { b=n%2; if(b==0) ec++; else oc++; } printf(%d no of even numbers ,ec); printf(%d no of odd numbers ,oc); }
Adeel Shabbir Programming in C CASE 65

void main() { int a,b,n; ec=0; oc=0; for(n=1;n<=10;n=n+1) { b=n%2; if(b==0) ec++; else oc++; } printf(%d no of even numbers ,ec); printf(%d no of odd numbers ,oc); }
Adeel Shabbir Programming in C CASE

66

void main() { int a,b,n; s=0; s=0; for(n=1;n<=10;n=n+1) { b=n%2; if(b==0) s=s+n; else s=s+n; } printf(%d no of even numbers ,s); printf(%d no of odd numbers ,s); }
Adeel Shabbir Programming in C CASE

67

void main() { int a,b,n,s1,s2; s1=0; s2=0; for(n=1;n<=10;n=n+1) { b=n%2; if(b==0) s1=s1+n; else s2=s2+n; } printf(sum of even numbers %d,s1); printf(sum of odd numbers %d ,s2); }
Adeel Shabbir Programming in C CASE

68

void main() { int a,b,n,s1,s2; s1=0; s2=0; for(n=1;n<=10;n=n+1) { b=n%2; if(b==0) s1=s1+n; else s2=s2+n; } printf(sum of even numbers %d,s1); printf(sum of odd numbers %d ,s2); }
Adeel Shabbir Programming in C CASE

69

void main() { int a,b,n,s1,s2; for(n=1;n<=10;n=n+1) { b=n%2; if(b==0) printf(%d,n);

}
}
Adeel Shabbir Programming in C CASE 70

void main() { int a,b,n,s1,s2; ec=0; for(n=1;n<=10;n=n+1) { b=n%2; if(b==0) { printf(%d,n); ec++; } }

Adeel Shabbir

Programming in C CASE

71

void main() { int a,b,n,s1,s2; ec=0; for(n=1;ec!=5;n=n+1) { b=n%2; if(b==0) { printf(%d,n); ec++; } }

Adeel Shabbir

Programming in C CASE

72

void main() { int a,b,n,s1,s2; ec=0; for(n=1;ec!=10;n=n+1) { b=n%2; if(b==0) { printf(%d,n); ec++; } }

Adeel Shabbir

Programming in C CASE

73

void main() { int a,b,n,s1,s2; ec=0; for(n=1;ec!=15;n=n+1) { b=n%2; if(b==0) { printf(%d,n); ec++; } }

Adeel Shabbir

Programming in C CASE

74

void main() { int a,b,n,s1,s2; m=5; ec=0; for(n=1;ec!=m;n=n+1) { b=n%2; if(b==0) { printf(%d,n); ec++; } } }
Adeel Shabbir Programming in C CASE

75

void main() { int a,b,n,s1,s2; m=10; ec=0; for(n=1;ec!=m;n=n+1) { b=n%2; if(b==0) { printf(%d,n); ec++; } } }
Adeel Shabbir Programming in C CASE

76

void main() { int a,b,n,s1,s2; scanf(%d,&m); ec=0; for(n=1;ec!=m;n=n+1) { b=n%2; if(b==0) { printf(%d,n); ec++; } } }
Adeel Shabbir Programming in C CASE

77

void main() { int a,s;


for(a=10;a>=1;a=a-1) { s=s+a; }

}
Adeel Shabbir Programming in C CASE

78

void main() { int a,s; s=0; for(a=10;a>=1;a=a-1) { s=s+a; } }


Adeel Shabbir Programming in C CASE

79

void main() { int a,f; f=0; for(a=10;a>=1;a=a-1) { f=f*a; } }


Adeel Shabbir Programming in C CASE

80

void main() { int a,f; f=1; for(a=10;a>=1;a=a-1) { f=f*a; } }


Adeel Shabbir Programming in C CASE

81

void main() { int a,f; f=1; for(a=10;a>=1;a=a-1) { f=f*a; } }


Adeel Shabbir Programming in C CASE

82

void main() { int a,f; f=1; for(a=5;a>=1;a=a-1) { f=f*a; } }


Adeel Shabbir Programming in C CASE

83

void main() { int a,f,n;

n=5; f=1;
for(a=n;a>=1;a=a-1) { f=f*a; } }
Adeel Shabbir Programming in C CASE 84

void main() { int a,f,n;

scanf(%d,&n); f=1; for(a=n;a>=1;a=a-1) { f=f*a; }


}
Adeel Shabbir Programming in C CASE 85

void main() { int a,f,n; for(n=1;n<5;n=n+1) { f=1; for(a=n;a>=1;a=a-1) { f=f*a; } printf(%d,f); } }


Adeel Shabbir Programming in C CASE 86

void main() { int a,f,n; f=1; for(n=1;n<5;n=n+1) { for(a=n;a>=1;a=a-1) { f=f*a; } printf(%d,f); } }


Adeel Shabbir Programming in C CASE 87

void main() { int a,f,n;

for(a=1;a<=10;a=a+1) { printf(%d,a); }

}
Adeel Shabbir Programming in C CASE 88

void main() { int a,b,n;

for(a=1;a<=10;a=a+1) { b=5*a; printf(%d,b); }

}
Adeel Shabbir Programming in C CASE 89

void main() { int a,b,n;

for(a=1;a<=10;a=a+1) { b=5*a; printf(%d %d,a,b); }

}
Adeel Shabbir Programming in C CASE 90

void main() { int a,b,n; n=5; for(a=1;a<=10;a=a+1) { b=n*a; printf(%d %d,a,b); }

}
Adeel Shabbir Programming in C CASE 91

void main() { int a,b,n; n=5; for(a=1;a<=10;a=a+1) { b=n*a; printf(%d %d %d,n,a,b); }

}
Adeel Shabbir Programming in C CASE 92

void main() { int a,b,n; n=5; for(a=1;a<=10;a=a+1) { b=n*a; printf(%d* %d=%d,n,a,b); }

}
Adeel Shabbir Programming in C CASE 93

void main() { int a,b,n; n=5; for(a=1;a<=10;a=a+1) { b=n*a; printf(%d* %d=%d,n,a,b); }

}
Adeel Shabbir Programming in C CASE 94

void main() { int a,b,n; n=5; for(a=1;a<=5;a=a+1) { b=n*a; printf(%d* %d=%d,n,a,b); }

}
Adeel Shabbir Programming in C CASE 95

void main() { int a,b,n; n=5; for(a=1;a<=7;a=a+1) { b=n*a; printf(%d* %d=%d,n,a,b); }

}
Adeel Shabbir Programming in C CASE 96

void main() { int a,b,n; n=5; for(a=1;a<=10;a=a+1) { b=n*a; printf(%d* %d=%d,n,a,b); }

}
Adeel Shabbir Programming in C CASE 97

void main() { int a,b,n; n=5; for(a=2;a<=10;a=a+1) { b=n*a; printf(%d* %d=%d,n,a,b); }

}
Adeel Shabbir Programming in C CASE 98

void main() { int a,b,n; n=5; for(a=5;a<=10;a=a+1) { b=n*a; printf(%d* %d=%d,n,a,b); }

}
Adeel Shabbir Programming in C CASE 99

void main() { int a,b,n; n=10; for(a=1;a<=10;a=a+1) { b=n*a; printf(%d* %d=%d,n,a,b); }

}
Adeel Shabbir Programming in C CASE 100

void main() { int a,b,n; n=7; for(a=1;a<=10;a=a+1) { b=n*a; printf(%d* %d=%d,n,a,b); }

}
Adeel Shabbir Programming in C CASE 101

void main() { int a,b,n; scanf(%d,&n); for(a=1;a<=10;a=a+1) { b=n*a; printf(%d* %d=%d,n,a,b); } }


Adeel Shabbir Programming in C CASE 102

void main() { int a,b,n; scanf(%d,&n); for(a=1;a<=10;a=a+1) { b=n*a; printf(\n%d* %d=%d,n,a,b);

}
}
Adeel Shabbir Programming in C CASE 103

void main() { int a,b,n; for(n=1;n<10;n=n+1) { for(a=1;a<=10;a=a+1) { b=n*a; printf(\n%d* %d=%d,n,a,b); } printf(\n********\n); } }
Adeel Shabbir Programming in C CASE 104

void main() { int a,b,n; for(n=1;n<5;n=n+1) { for(a=1;a<=10;a=a+1) { b=n*a; printf(\n%d* %d=%d,n,a,b); } printf(\n********\n); } }
Adeel Shabbir Programming in C CASE 105

void main() {int a,b,n; for(n=1;n<20;n=n+1) { for(a=1;a<=10;a=a+1) { b=n*a; printf(\n%d* %d=%d,n,a,b); } printf(\n********\n); } }
Adeel Shabbir Programming in C CASE 106

void main() { int a,b,n; for(n=5;n<20;n=n+1) { for(a=1;a<=10;a=a+1) { b=n*a; printf(\n%d* %d=%d,n,a,b); } printf(\n********\n); } }
Adeel Shabbir Programming in C CASE 107

void main() { int a,b,n; for(n=1;n<20;n=n+2) { for(a=1;a<=10;a=a+1) { b=n*a; printf(\n%d* %d=%d,n,a,b); } printf(\n********\n); } }
Adeel Shabbir Programming in C CASE 108

void main() { int a,b,n; for(n=1;n<10;n=n+1) { for(a=1;a<=5;a=a+1) { b=n*a; printf(\n%d* %d=%d,n,a,b); } printf(\n********\n); } }
Adeel Shabbir Programming in C CASE 109

void main() { int a,b,n; for(n=1;n<20;n=n+2) { for(a=1;a<=10;a=a+1) { b=n*a; printf(\n%d* %d=%d,n,a,b); } printf(\n********\n); } }
Adeel Shabbir Programming in C CASE 110

void main() { int a,b,n; for(n=1;n<20;n=n+2) { for(a=1;a<=10;a=a+1) { b=n*a; printf(\n%d* %d=%d,n,a,b); } printf(\n********\n); } }
Adeel Shabbir Programming in C CASE 111

void main() { int r,c;


for(r=1;r<=5;r=r+1) { printf(\n); }

}
Adeel Shabbir Programming in C CASE

112

void main() { int r,c;


for(c=1;c<=5;c=c+1) { printf(*); }

}
Adeel Shabbir Programming in C CASE

113

void main() { int r,c;


for(c=1;c<=10;c=c+1) { printf(*); }

}
Adeel Shabbir Programming in C CASE

114

void main() { int r,c;


for(c=1;c<=15;c=c+1) { printf(*); }

}
Adeel Shabbir Programming in C CASE

115

void main() { int r,c; for(r=1;r<=5;r=r+1) { printline of staric printf(\n); } }


Adeel Shabbir Programming in C CASE 116

void main() { int r,c; for(r=1;r<=5;r=r+1) { for(c=1;c<=15;c=c+1) { printf(*); } printf(\n); } }


Adeel Shabbir Programming in C CASE 117

void main() { int r,c; for(r=1;r<=5;r=r+1) { for(c=1;c<=5;c=c+1) { printf(*); } printf(\n); } }


Adeel Shabbir Programming in C CASE 118

void main() { int r,c; for(r=1;r<=5;r=r+1) { for(c=1;c<=10;c=c+1) { printf(*); } printf(\n); } }


Adeel Shabbir Programming in C CASE 119

void main() { int r,c; for(r=1;r<=5;r=r+1) { for(c=1;c<=5;c=c+1) { printf(*); } printf(\n); } }


Adeel Shabbir Programming in C CASE 120

void main() { int r,c; for(r=1;r<=10;r=r+1) { for(c=1;c<=5;c=c+1) { printf(*); } printf(\n); } }


Adeel Shabbir Programming in C CASE 121

void main() { int r,c; for(r=1;r<=8;r=r+1) { for(c=1;c<=5;c=c+1) { printf(*); } printf(\n); } }


Adeel Shabbir Programming in C CASE 122

void main() { int r,c; for(r=1;r<=20;r=r+1) { for(c=1;c<=5;c=c+1) { printf(*); } printf(\n); } }


Adeel Shabbir Programming in C CASE 123

void main() { int r,c; for(r=1;r<=20;r=r+1) { for(c=1;c<=r;c=c+1) { printf(*); } printf(\n); } }


Adeel Shabbir Programming in C CASE 124

void main() { int r,c; for(r=1;r<=5;r=r+1) { for(c=1;c<=2*r-1;c=c+1) { printf(*); } printf(\n); } }


Adeel Shabbir Programming in C CASE 125

void main() { int r,c; for(r=1;r<=20;r=r+1) { for(c=1;c<=2*r+1;c=c+1) { printf(*); } printf(\n); } }


Adeel Shabbir Programming in C CASE 126

void main() { int r,c; for(r=1;r<=20;r=r+1) { for(c=1;c<=-2*r+11;c=c+1) { printf(*); } printf(\n); } }


Adeel Shabbir Programming in C CASE 127

void main() { int r,c; for(r=1;r<=5;r=r+1) { for(c=1;c<=3*r-2;c=c+1) { printf(*); } printf(\n); } }


Adeel Shabbir Programming in C CASE 128

void main() { int r,c; for(r=1;r<=5;r=r+1) { n=1; for(c=1;c<=5;c=c+1) { printf(%d,n); } printf(\n); } }


Adeel Shabbir Programming in C CASE 129

void main() { int r,c; for(r=1;r<=5;r=r+1) { n=3; for(c=1;c<=5;c=c+1) { printf(%d,n); } printf(\n); } }


Adeel Shabbir Programming in C CASE 130

void main() { int r,c; for(r=1;r<=5;r=r+1) { n=6; for(c=1;c<=5;c=c+1) { printf(%d,n); } printf(\n); } }


Adeel Shabbir Programming in C CASE 131

void main() { int r,c; for(r=1;r<=5;r=r+1) { n=6; for(c=1;c<=5;c=c+1) { printf(%d,n); } printf(\n); n=n+1; } }
Adeel Shabbir Programming in C CASE 132

void main() { int r,c; for(r=1;r<=5;r=r+1) { n=6; for(c=1;c<=5;c=c+1) { printf(%d,n); n=n+1; } printf(\n); }

Adeel Shabbir

Programming in C CASE

133

void main() { int r,c; for(r=1;r<=5;r=r+1) { n=1; for(c=1;c<=5;c=c+1) { printf(%d,n); n=n+1; } printf(\n); }

Adeel Shabbir

Programming in C CASE

134

void main() { int r,c; n=1; for(r=1;r<=5;r=r+1) { for(c=1;c<=5;c=c+1) { printf(%d,n); n=n+1; } printf(\n); } }
Adeel Shabbir Programming in C CASE 135

void main() { int r,c; n=2; for(r=1;r<=5;r=r+1) { for(c=1;c<=5;c=c+1) { printf(%d,n); n=n+1; } printf(\n); } }
Adeel Shabbir Programming in C CASE 136

void main() { int r,c; for(r=1;r<=5;r=r+1) { n=1; for(c=1;c<=5;c=c+1) { printf(%d,n); n=n+1; } printf(\n); } }
Adeel Shabbir Programming in C CASE 137

void main() { int r,c; for(r=1;r<=5;r=r+1) { n=r; for(c=1;c<=5;c=c+1) { printf(%d,n); n=n+1; } printf(\n); } }
Adeel Shabbir Programming in C CASE 138

void main() { int r,c; for(r=1;r<=5;r=r+1) { n=2*r-1; for(c=1;c<=5;c=c+1) { printf(%d,n); n=n+1; } printf(\n); } }
Adeel Shabbir Programming in C CASE 139

void main() { int r,c; for(r=1;r<=5;r=r+1) { n=2*r+1; for(c=1;c<=5;c=c+1) { printf(%d,n); n=n+1; } printf(\n); } }
Adeel Shabbir Programming in C CASE 140

void main() { int r,c; for(r=1;r<=5;r=r+1) { n=-2*r+11; for(c=1;c<=5;c=c+1) { printf(%d,n); n=n+1; } printf(\n); } }
Adeel Shabbir Programming in C CASE 141

void main() { int r,c; for(r=1;r<=5;r=r+1) { n=1; for(c=1;c<=5;c=c+1) { printf(%d,n); n=n+1; } printf(\n); } }
Adeel Shabbir Programming in C CASE 142

void main() { int r,c; for(r=1;r<=5;r=r+1) { n=1; for(c=1;c<=r;c=c+1) { printf(%d,n); n=n+1; } printf(\n); } }
Adeel Shabbir Programming in C CASE 143

void main() { int r,c; for(r=1;r<=5;r=r+1) { n=1; for(c=1;c<=2*r-1;c=c+1) { printf(%d,n); n=n+1; } printf(\n); } }
Adeel Shabbir Programming in C CASE 144

void main() { int r,c; for(r=1;r<=5;r=r+1) { n=1; for(c=1;c<=-2*r+11;c=c+1) { printf(%d,n); n=n+1; } printf(\n); } }
Adeel Shabbir Programming in C CASE 145

void main() { int r,c; for(r=1;r<=5;r=r+1) { n=1; for(c=1;c<=r;c=c+1) { printf(%d,n); n=n+1; } printf(\n); } }
Adeel Shabbir Programming in C CASE 146

void main() { int r,c; for(r=1;r<=5;r=r+1) { n=1; for(c=1;c<=r;c=c+1) { printf(%d,n); n=n+2; } printf(\n); } }
Adeel Shabbir Programming in C CASE 147

void main() { int r,c; for(r=1;r<=5;r=r+1) { n=1; for(c=1;c<=r;c=c+1) { printf(%d,n); n=n+3; } printf(\n); } }
Adeel Shabbir Programming in C CASE 148

void main() { int r,c; for(r=1;r<=5;r=r+1) { n=1; for(c=1;c<=r;c=c+1) { printf(%d,n); n=n+r; } printf(\n); } }
Adeel Shabbir Programming in C CASE 149

void main() { int r,c; n=1; for(r=1;r<=5;r=r+1) { for(c=1;c<=r;c=c+1) { printf(%d,n); n=n+r; } printf(\n); } }
Adeel Shabbir Programming in C CASE 150