#include<stdio.h>
#include<conio.h>
void main( )
{
int a[50],i,n,s,t=0;/* the digit 50 can be any integer, its a user defined function a[limit]*/
clrscr( );
printf("\n\nenter the number of elements u want to enter");
scanf("%d",&n);
printf("\n\nenter the numbers u desire");
for(i=0;i<n;i++)
scanf("%d",&a[i]);
printf("enter the element to be counted");
scanf("%d",&s);
for(i=0;i<n;i++)
{
if(s==a[i])
t++;
}
printf("the number u entered has occured %d number of times",t);
getch( );
}
#include "stdio.h" int main() { unsigned int number, count; printf("Enter the Number \t"); scanf("%d", &number); printf("The even numbers are: \n"); for(count = 0x01; (count < number && number!= 0x00)) { if(count%2) { }else { printf("%d\n", count); } count++; } return 0; }
I would use a loop like this: const char *p= str-1; size_t count= 0; while (*++p) if (islower (*p)) ++count;
yyu5uty
.... String line = "This is example program with spaces"; String[] tokens = line.split(" "); System.out.println(tokens.length-1); .......
1. Find algorithm.2. Implement it.Hint: if a non-zero N number has K 1-bits, then (N AND N-1) has K-1 1-bits.