# informatics c

Post on 07-Apr-2015

309 views

Category:

## Documents

Embed Size (px)

TRANSCRIPT

KALPIT G. SONI B.Sc. M.C.A. 2-Gurukrupa Society. B/h Shantinagar Society. N.K.Road Nadiad 387 001 Phone No. : 0268-2520731 ( R. ) 9898230909 ( M. ) Email id : kalpitsoni1@yahoo.com* * * * * * * * * * * *

Basic Programs.* * * * * * * * * * * * Write a Program for the following output. Informatics. Output Output Output : : : Informatics Nadiad. Informatics Nadiad. Informatics Nadiad. Output : Informatics Nadiad.

Write a Program to draw Rectangle. Write a Program to Print Address. Write a Program to print Address in Rectangle. Write a Program to print Swastik. Write a Program to explain Comment in C. Write a Program to explain Data Types. Write a Program to read one number and display it. Write a Program to read one number and display it with message. Write a Program to find power(x,y) Write a Program to explain math function. Write a Program to display ASCII value of given character. Write a Program to display character of given ASCII value. Write a Program to add two numbers.

Write a Program to multiply two numbers. Write a program to perform all arithmetic operators ( + , - , * , / , %) Write a program to find month and day of total days. Write a Program to interchange two values using third variable. Write a Program to interchange two values without using three variables. Write a Program to find area of a Rectangle. Write a Program to find volume of a Cube. *h) : ( Area = l * b ) : ( Volume = l * b

Write a Program to find area of Triangle. : ( Area = b * h *0.5 ) Write a Program to calculate area of Circle. r) : ( Area = Pi * r *

Write a Program to calculate simple interest : ( S.I. = ( p * r * n ) / 100 ) Write a Program to compute centigrade to Fahrenheit ( F = 1.8 * c + 32 ) Write a Program to computer Fahrenheit to centigrade. ( C = (F32)/1.8 ) A company has following scheme for payment t their staff. Net Salary = Gross Salary Deduction. Gross Salary = Basic + DA + HRA + Medical. Deduction = Insurance + PF. DA : 50 % of Basic HRA : 10 % of Basic Medical : 4 % of Basic PF : 5 % of Gross. Insurance : 7 % of Gross. Write a Program to calculate net payment to any employee.

*

Read the price of item in decimal form. Ex. 12.50 and separate Rs and Price from the given value. Ex. 12 Rupees and 50 Paise. * * * * * * * * * * *

Conditional Programs* * * * * *

( if, if-else, if-else ladder, Switch-case, goto ,continue) * * * * * *

Write a Program to read marks of a student from keyboard whether the student is pass. Write a Program to read marks of a student from keyboard whether the student is pass or fail. To check whether the given number is odd or even. Write a Program to read number from keyboard whether it is positive. To check whether the given number is positive or negative. To check whether the given number is positive, negative or zero. To check whether the given number is one-digited, twodigited, three-digited or more than three digited. To check whether the given number is perfect square or not. To check whether the given year is leap year or not. A leap year is a year which is evenly divisible by 4,but if it is evenly divisible by 100 then it is not a leap year, but if it is evenly divisibly by 400 then it is a leap year. To check whether the given character is Alphabetic or a digit or a special character. To check whether the given character is in Uppercase or in Lowercase. To check whether the given number is divisible by 5 or not.

Write a Program to find average of two numbers. Write a Program to find maximum number out of two numbers. Write a Program to find minimum number out of two numbers. Write a Program to find maximum number out of three numbers. Write a Program to find minimum number out of three numbers. Write a Program to find middle number out of three numbers. Write a Program to read marks from keyboard and your Program should display equivalent grade according to following table. Marks 100 80 60 79 35 59 0 34 Grade Distinction First Class Second Class Fail

Write a Program that reads a number from 1 to 7 and according should display Monday to Sunday ( Using Switch-case ) Write a Program that reads a number from 1 to 7 and according should display Monday to Sunday ( Using ifelse ) Write a Program that reads a number from 1 to 12 and according should display January to December. ( Using Switch-case ) Write a Program that reads a number from 1 to 12 and according should display January to December. ( Using Switch-case ) Make a Simple Calculator ( Using ifelse if ) Make a Simple Calculator ( Using Switch-case )

A function f is defined as follows : : ax3 bx2 + cx d : : -ax3 + bx2 cx + d 0 * * * * * * : : : : : : * * if ( x > k ) if ( x < k ) if ( x =k ) * * * * * * * * * *

F(x)

* *

Loops*

*

* *

Print the series Print the series Print the series Print the series Print the series Print the series

1 2 3 4 5 6 7 8 9 10 1 2 3 4 .N 10 9 8 7 6 5 4 3 2 1 1 4 7 10 1 4 9 16 25 36 35 24 15 8 3 0

To calculate the sum of first 10 natural numbers. To calculate the sum of first N Natural numbers. To calculate the sum of even numbers between 1 to 10. To calculate the sum of even numbers between 1 to N. To calculate the sum of odd numbers between 1 to 10. To calculate the sum of odd numbers between 1 to N. To calculate the average of even numbers between 1 to 10. To calculate the average of even numbers between 1 to N. To calculate the average of odd numbers between 1 to 10. To calculate the average of odd numbers between 1 to N.

To read any five numbers and print the average value. Write a Program to find out all the numbers divisible by 5 and 7 between 1 to 100. Find out sum of digits of given number. Ex. 4567 : 4 + 5 + 6 + 7 : 22 Find out sum of digits of given number until the number becomes single digit. Ex. 4567 : 4 + 5 + 6 + 7 : 22 : 2 + 2 : 4 Print Multiplication table for a given number Write a Program to find factor of a given number. Print Multiplication table for 1*1 to N*N. Write a Program to find the factorial of a given number. Write a Program to find Reverse of a given number Find out sum of first and last digit of a given number To check the given number is palindrome or not. ( 1221 ) To check the given number is Armstrong or not. Ex. : 153 : 1 + 125 +27 = 153 To check the given number is Prime or not. Consider a currency system in which there are notes of seven denominations, namely Rs. 1, Rs. 2, Rs. 5, Rs. 10, Rs. 20, Rs. 50, Rs. 100. A sum of Rs. N is entered through keyboard. Write a function to compute the smallest number of notes that will combine to give Rs. N. Find out the Armstrong number between 1 to N. Find out the Prime number between 1 to N. To find the sum of first N prime numbers.

To find the value of the following formula. nCr = n! / ( r! * ( n r ) ! ) to find the value of the following formula. nPr = n! / ( n r )! Write a Program to find out largest digit in an given integer. Ex. 4562 : Largest Number is 6 Check whether the given number is perfect of not. A number is perfect if its sum of digits is same as multiplication of digits. ( Ex. 123 : 1 * 2 * 3 = 1 + 2 + 3 ) Write a Program to find greatest common divisor ( GCD ) for two positive integer numbers. ( Ex. 15 and 45 Ans : 15 ) Write a Program to find out least common multiplier ( LCM ) from two positive integer numbers. To check whether the given number is binary or not. To check whether the given number is octal or not. Series :

1+2+3+..... +n 2+4+6+.....+n 1+3+5+.....+n 1 + 4 9 + 16 25 + 36. . . . . + n2 1! + 2! + 3! + 4! + . . . . . + n! 1/1! + 1/2! + 1/3! + . . . . . + 1/n! x + x^2 + x^3 + x^4 + . . . . . + x^n. 1 + 2 +4 + 8 + 16 + 32 + . . . . . n terms. 1 + + 1/9 + 1/16 + . . . . . n terms

Write a Program to calculate Fibonacis series no 1 1 2 3 5 8...... Print first 50 odd numbers. Note that Program should display only five numbers per line. Patterns. * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

* * *

* *

*

* * * * * * *

* * * * * * * *

* * * * * *

* * * * * *

* * * * * *

* * *

* * * *

* * * * *

1 1 1 1

2 2 2

3 3

4

1

2

3

4 2 2 2 2 4 4

5 1 1 1 1 1 5

5. 1 1 1 1 1 5 4 3 2 1 1 2 3 4 5

4 4 2 2 2 2 4 3 2 1

3 3 3 3 3 3

3 2 1

2 1

1

2 3 4 5

3 4 5

4 5 2 3 4 5 5 4

5 1 2 3 4 5 5

5 5 4 3 2 1 5

4 5 5 4 3 2 5 4

3 4 5 5 4 3

5 4 3

5 4 3 2

5 4 3 2 1

\$

\$ \$ \$ 1 1 1 1 1

\$ \$ \$ 0 0 0 0

\$ \$

\$

1 1 1

0 0 0 0 0 0 0 0

1 1 1 1 1 1 1

1 1 1 1 1 1 1

0 0 0 0 0 0 0 0

1 1 1 1 1 1

1 1 1

0 0 0 0

1 1 1 1 1

1 0 1 0 1

0 1 0 1

1 0 1

0 1 0 1 0 1 1 0

1 1 0 1 0 1 1

1 1 0 1 0 1

0 1 1 0 1 0

1 0 1 1 0 1

1

1 0

1 0 1

1 0 1 0

1 0 1 0 1

1 2 4 7 11

3 5 8 12

6 9 13

10 14

15 1 2 4 7 11 15

15 11 7 4 2 1 15

10 14 12 8 5 3 14 10

6 9 13 13 9 6

3 5 8 12 14 10

13 9 6

12 8 5 3 2 1

11 7 4 2 1 1

5 4 3 2 1 1 1 1 1 1 5 5

4 3 2 1 2 2 2 2

3 2 1

3 3 3

4 4

5

4

5 5 5 1 1 1 1 1

4 4 4 4 4 4 4

3 3 3

2 2

1

9 9 9

16 16

25 1

2 3 4 5 5 * * * * * * * * * 5 4 3 2 1 A A A A A A B B B B B B 1 2 1 3 * * * * * * * * 4 5 * 3

2 3 4 5 * * * * * * * * * * * * 4 5

4 3 2 1 2 1

C C C C C C

D D D D D D

E E E E E

E A A A A A a a a a a b b b b B B C B C D B C D E

c