Thứ Hai, 29 tháng 9, 2014

B1 Day 5 (Function)

1. Write a C program that accepts a number and square the number with the help of a function.
To do this,
a. Declare a function.
b. Accept the number.

c. Pass the number to the function and return the square of that number


2. Write a C program to find the area and perimeter of a circle.


3. Write a program with a function that takes two int parameters, adds them together, then returns the sum. The program should ask the user for two numbers, then call the function with the numbers as arguments, and tell the user the sum.



Chủ Nhật, 28 tháng 9, 2014

test2

B1; Prime number


B3 Day 5 (Array)

1. Write a program which prints the letters in a char array in reverse order. For
example, if the array contains {'c', 's', 'c', '2', '6', '1'}the output (to the terminal)

should be "162csc"


2. Write a  program : declare a char array and the size of the array (of type char). This function counts the number of digit letters in the char array.


3. Write a program that counts the number of words in a string


4. Write a function that scans a character array for the character - and replaces it with _




Thứ Năm, 25 tháng 9, 2014

B1 Day 5 (Array)


1. Write a program that asks the user to type 10 integers of an array. The program must compute and write how many integers are greater than or equal to 10.


2. Write a program that asks the user to type 10 integers of an array. The program must output the largest element in the array, and the index at which that element was found.


3. Input values are accepted from the user into the array. Displays highest of the entered values. Prints average of values entered.


4. Write a program that accepts the following numbers in an array and reverses the array


5. Write a program to count the number of vowels in a line of text






Thứ Ba, 16 tháng 9, 2014

B3 Day 4 (Do_while loop)

Do_While loop


B1: Declare a variable which has the age of the person. Print the user’s name as many times as his age


B2: The program displays even numbers from 1 to 30.

B3: The program displays numbers from 10 to 0 in the reverse order
B4: The program will accept integers and display them until zero (0) is entered

B5: Write a program to print the series 100, 95 , 90, 85,………., 5.












B2 Day 4 (For loop)

B1: Declare a variable which has the age of the person. Print the user’s name as many times as his age


B2: The program displays even numbers from 1 to 30.


B3: . The program displays numbers from 10 to 0 in the reverse order


B4: The program will accept integers and display them until zero (0) is entered


B6:  Write a program to print the series 100, 95 , 90, 85,………., 5.


B8:  Write a program to generate the Fibonacci series. (1,1,2,3,5,8,13,………)