Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions *triangle.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#include<stdio.h>
main ()
{ int i,j,k;
for(j=1;j<=5;j++)
{
for(i=1;i<=5;i++)
{
if(j>=i)
{
for(k=1;k<=5;k++)
{
if(i<=k)
printf("*");
}
printf("\n");
}
}
}
}
13 changes: 13 additions & 0 deletions countingpyramid.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#include<stdio.h>
main()
{
int i,j;
for(i=1;i<=5;i++)
{
for(j=1;j<=5;j++)
{ if(i>=j)
printf("%d",i+j-1);
}
printf("\n");
}
}
18 changes: 18 additions & 0 deletions pyramid.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#include<stdio.h>
main()
{
int i,j;
for(i=1;i<=4;i++)
{
for(j=1;j<=4;j++)
{
if(i>j)
{
printf(" ");
}
else
printf("*");
}
printf("\n");
}
}
29 changes: 29 additions & 0 deletions stick game.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#include<stdio.h>
int main (){
int i,j,k,l;
char c;
printf("Hello there. Welcome. Suppose there are 11 sticks in front of you.You have to pick any number of stics from 1 to 4 (both 1 and 4 included) from 11 stics.Then allow computer to take his chance and choose any number of stics from 1 to 4.The player whose turn comes when 1 stick remains looses or the player who pics the last stick looses...so player how many sticks you chhose\n");
scanf ("%d",&i);
if(i>=5 || i<=0){
printf("invalid choice");
}
else
{
printf ("\nthe number of stick you choose=%d \nsticks remaining =%d\n the computer choose %d\nsticks remaining after first round=%d.\n ...your turn again user ",i,11-i,5-i,6);

scanf ("%d",&k);
if(k>=5 || k<=0){
printf("invalid choice");
}
else
{
printf("\nthe number of stick you choose=%d \nsticks remaining =%d\n the computer choose %d\nsticks remaining after round=%d..YOu LOOSE\n ",k,6-k,5-k,1);
}

}




return 0;
}
15 changes: 15 additions & 0 deletions trial.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#include<stdio.h>
main()
{
int a;
int msg();

}


int msg()

{ printf("i m a fool");
return(0);
main();
}