You don't need a shell script to do this; use the 'grep' command with the '-c' option to count the number of occurrences of some pattern.
Write out the numbers 1 to 100. Count the number of times 1 appears.
120
To write repeated multiplication in an exponential notation, you should write the number that has to be multiplied as the base. Count the number of times that the number is used.
Write a program to count the number of IS in any number in register B and put the count in R5.
abhimanyu
Count how many parts there are in total (both shaded and unshaded) and write this as the denominator (bottom number) of the fraction. Count how many shaded parts there are and write this as the numerator (top number) of the fraction. You now have the fraction of the whole that is shaded.
If you count 11 as 2 instances, the digit 1 appears 18 times if you don't count 10, 19 times if you do. 10,11,12,13,14,15,16,17,18,19,21,31,41,51,61,71,81,91
#include "stdio.h" #include "conio.h" #define TABLE_UP_TO_20 20 void table_of_a_number(int number); int main() { int i = 0x00; printf("Enter a positive number in decimal whose table has to be generated"); scanf("%d",&i); table_of_a_number(i); return 0; } void table_of_a_number(int number) { int count = 0x00; for(count = 0x01;count <=TABLE_UP_TO_20 ;count++) { /* THis will print the table*/ printf(" %d * %d = %d\n", number,count, (number*count)); }
#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; }
To find the exponent count the number of places from the decimal to the end of the number. This will let you write the number in exponential form or in scientific notation160000=1.6 x 105
-- Look at the picture, count how many squares are shaded, write down the number. -- Look at the picture again, count how many squares there are all together, whether they're shaded or not shaded. Write down the number. -- Make a fraction. Put the first number on top, put the second number on the bottom. (-- Reduce the fraction to lowest terms, it necessary, and if you know how to do that.)
The number 6 appears 20 times when counting from one to one hundred.