Welcome to Scribd. Sign in or start your free trial to enjoy unlimited e-books, audiobooks & documents.Find out more
Standard view
Full view
of .
0 of .
Results for:
P. 1
Start - Up C Programs Write a Program: 1. To

Start - Up C Programs Write a Program: 1. To

Ratings:

4.67

(1)
|Views: 2,520|Likes:
This is very good document for the all list of C programms for all IT students..hope it will help them.
This is very good document for the all list of C programms for all IT students..hope it will help them.

Availability:

See more
See less

05/19/2012

pdf

text

original

Start - up C programsWrite a Program:
1.

To print "Hello, World".2.

To add two numbers and print the result.3.

To add n integers and print the result; take the value of n as user input.4.

To print the larger of two numbers.5.

To calculate the area and circumference of a circle, given the radius.6.

That deliberately makes the following mistakes:i.

Prints a floating-point number using the %d conversion.ii.

Prints an integer using the %f conversion.iii.

Prints a character using the %d conversion.7.

F = (9/5) C + 32.8.

That takes hours and minutes as input, and then outputs the total number of minutes.9.

That takes an integer as the number of minutes, and outputs the total hours and minutes.10.

To tell if the given year is a leap year. [Hint: A leap year is any year divisible by 4, unless theyear is divisible by 100, but not 400.]11.

To find the average of n numbers; take the value of n as user input.12.

To test whether a number is prime or not.

Fundamentals of CWrite a Program:
1.

To reverse a number 2.

To swap two variables without using temporary variable.3.

To swap three variables without using temporary variable.4.

To whether the given number is palindrome or not.5.

To find whether the given number is Armstrong number or not.6.

To find whether the given number is prime number or not.7.

To find given year is leap year or not.8.

To print multiplication table of a given number.9.

To find factorial of a given number.10.

To find whether given number is power of 2 or not.11.

To print Fibonacci series 0 1 1 2 3 5 8........... .12.

To find sum of digits of a given number.13.

To convert UPPER case letters to LOWER case.14.

To convert LOWER case letters to UPPER case.15.

To convert number to word. e.g. i/p : 45 o/p :forty five16.

To find whether the given number is perfect square or not.

FunctionsWrite a Program:
1.

Write a function
strrindex(s,t)
, which returns the position of the rightmost occurrence of
in
s
,or -1 if there is none.2.

Write a function
atof

to handle scientific notation of the form 123.45e-6.3.

Write a function
strlen(s)
which will return the length of the string
s
, or -1 if it is null string.4.

Write a function
toupper(s)

which will convert all occurrences of lowercase characters in string sto uppercase.
5.

Write a function
strcat(s1,s2)

which will append a copy of the string
s2
to the end of string
s1.
6.

Write a function
exchange(x,y)
to interchange the values of two variables x and y without usingtemporary variable.7.

Write a recursive function to find the sum of digits of a number.8.

Write a recursive function that will generate and print the first n Fibonacci numbers.9.

Write a function prime that returns 1 if its argument is a prime number and returns 0 otherwise.10.

Write a recursive function
reverse(s)
which reverses the string s in place