Skip to content

Commit 817e18f

Browse files
Data Added
1 parent 43ca364 commit 817e18f

File tree

138 files changed

+3608
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

138 files changed

+3608
-0
lines changed
Binary file not shown.

3_Programs/CP1DOWHI.C

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*DOCUMENTATION SECTION
2+
WAP TO SHOW DEMO OF DO...WHILE LOOPING STATEMENT
3+
*/
4+
#include <stdio.h>
5+
#include <conio.h>
6+
void main()
7+
{
8+
int i = 1;
9+
int n,sum=0;
10+
clrscr();
11+
printf("WHAT IS YOUR WISH NUMBER:");
12+
scanf("%d",&n);
13+
do
14+
{
15+
printf("I AM INSIDE DO LOOP: %d\n",i);
16+
sum = sum +i;
17+
i = i+1;
18+
19+
}while(i<=n);
20+
printf("I AM OUTSIDE DO LOOP:\n");
21+
printf("YOUR TOTAL WISH NUMBER SUM IS : %d",sum);
22+
23+
24+
getch();
25+
26+
}

3_Programs/CP1SWITC.C

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
/*DOCUMENTATION SECTION
2+
WAP TO SHOW DEMO OF switch case STATEMENT
3+
*/
4+
#include <stdio.h>
5+
#include <conio.h>
6+
void main()
7+
{
8+
int choice;
9+
int choicem;
10+
clrscr();
11+
printf("\n WHAT YOU WOULD LIKE TO DO TODAY:\n");
12+
printf("1.WATCH MOVIE:\n");
13+
printf("2.PLAY GAMES:\n");
14+
printf("3.VISIT ZOO:\n");
15+
printf("4.GO TO DINNER:\n");
16+
printf("5.GO SHOPPING:\n");
17+
printf("6.DO NOTHING:\n");
18+
scanf("%d",&choice);
19+
switch(choice)
20+
{
21+
case 1:
22+
printf("\n YOU SELECTED TO WATCH MOVIE");
23+
printf("\nPLEASE SELECT YOUR MOVIE:");
24+
printf("\nPLEASE SELECT YOUR MOVIE:");
25+
printf("\n1. AAVTAR:");
26+
printf("\n2. ARMAGEDON:");
27+
scanf("%d",&choicem);
28+
switch(choicem)
29+
{
30+
case 1:
31+
printf("\n YOU SELECTED AAVTAR MOVIE");
32+
break;
33+
34+
}
35+
break;
36+
case 2:
37+
printf("\n YOU SELECTED TO PLAY GAMES");
38+
break;
39+
case 3:
40+
printf("\n YOU SELECTED TO VISIT ZOO");
41+
break;
42+
43+
case 4:
44+
printf("\n YOU SELECTED TO GO TO DINNER");
45+
break;
46+
47+
case 5:
48+
printf("\n YOU SELECTED TO DO SHOPING");
49+
break;
50+
51+
case 6:
52+
printf("\n YOU SELECTED TO DO NOTHING");
53+
break;
54+
55+
default:
56+
printf("\n YOUR CHOICE IS SAME AS CHOICE NO 6:");
57+
printf("\n BYE");
58+
}
59+
printf("\nEXIT FROM SWITCH CASE");
60+
getch();
61+
62+
}

3_Programs/CP2FORDE.C

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*DOCUMENTATION SECTION
2+
WAP TO SHOW DEMO OF FOR LOOP STATEMENT
3+
*/
4+
#include <stdio.h>
5+
#include <conio.h>
6+
void main()
7+
{
8+
int i,n,sum=0;
9+
clrscr();
10+
printf("WHAT IS YOUR WISH NUMBER:");
11+
scanf("%d",&n);
12+
13+
for (i=1;i<=n;i++)
14+
{
15+
printf("I AM INSIDE FOR LOOP\n");
16+
sum = sum +i;
17+
}
18+
printf("YOUR TOTAL WISH NUMBER SUM IS : %d\n",sum);
19+
printf("VALUSE OF i is = %d",i);
20+
getch();
21+
22+
23+
24+
25+
26+
27+
28+
29+
30+
31+
32+
}

3_Programs/CP3FOR2.C

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/*DOCUMENTATION SECTION
2+
WAP TO SHOW DEMO OF FOR LOOPING STATEMENT
3+
*/
4+
#include <stdio.h>
5+
#include <conio.h>
6+
void main()
7+
{
8+
long int i,n,sum=0;
9+
clrscr();
10+
printf("\n\n\n\n\nWHAT IS YOUR WISH NUMBER:");
11+
scanf("%d",&n);
12+
for (i=1000;i>=n;i++)
13+
printf("%ld HELLO\n",i);
14+
getch();
15+
}

3_Programs/CP3NFOR.C

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*DOCUMENTATION SECTION
2+
WAP TO SHOW DEMO OF NESTED FOR LOOP STATEMENT
3+
*/
4+
#include <stdio.h>
5+
#include <conio.h>
6+
void main()
7+
{
8+
int i,j;
9+
clrscr();
10+
// 1 X 1 = 1 n*i a*b; a =1, b =4 , a*b =4
11+
// 1 X 2 = 2
12+
// 1 X 10 =10
13+
14+
for(i=1;i<=10;i++)
15+
{
16+
// printf("TABLE OF %d :",i);
17+
for (j=1;j<=5;j++)
18+
{
19+
printf("%d X %d = %d\t",j,i,i*j);
20+
}
21+
printf("\n");
22+
}
23+
getch();
24+
25+
}

0 commit comments

Comments
 (0)