Skip to content

Commit

Permalink
added
Browse files Browse the repository at this point in the history
  • Loading branch information
gauravkhatrishots committed Mar 2, 2018
1 parent b07ba32 commit 0eaf706
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
15 changes: 15 additions & 0 deletions binary.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#include<stdio.h>
void main()
{
int a;

printf("enter the value of a");
scanf("%d",&a);

while (a>0)
{
printf("%d",a%2);
a=a/2;
}
}

22 changes: 22 additions & 0 deletions count_e.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#include<stdio.h>
int count (char *);
void main()
{
int c=0;
char* s[]={"we will teach you how to","move a mountain","Level a building","Erase the past","Make a mililon"};
for (int i=0;i<5;i++)
c+=count(s[i]);
printf("%d",c);
}
int count( char*p)
{
int c=0;
for(int i=0;p[i]!='\0';i++)
{
if(p[i]=='e')
c++;
}

return c;
}

0 comments on commit 0eaf706

Please sign in to comment.