Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 10

SET- 1 Simple C Programs..

1. Write a program to print Hello World on the screen. 2. Write a program to Program to read one number and display it. (With messages) 3. Write a program that will obtain the length and width o a rectangle rom user and calculate its area! perimeter and diagonal. ". #he straight line method o computing the yearly depreciation o the $alue o an item is gi$en by %epreciation& (Purchase Price'(al$age )alue)* +ears o (er$ice. Write a program to determine the sal$age $alue o an ,tem when the purchase price! years o ser$ice and the annual depreciation are gi$en -. .rea o a triangle is gi$en by the ormula .&s/rt(((('a)(('b)(('c)) Where a!b and c are sides o the triangle and 2(&a0b0c. Write a program to compute the area o the triangle gi$en the $alues o a!b and c . 1. Write a program to 2on$ert temperature in 2elsius to 3ahrenheit * 3ahrenheit to 2elsius. 3& (4*-) 52 0 32 6. Write a program to ind the sum o the digits o a 3'digit integer constant. 7. Write a program to interchange the $alues o two $ariables. 4. Write a program to .ssign $alue o one $ariable to another using post and pre increment operator and print the results. 18. Write a program to 9ead the price o item in decimal orm e.g. 12.-8. (eparate rupees and paisa rom the gi$en $alue e.g. 12 rupees and -8 paisa.

SET 2 :Write a C program using if , ifelse ,switc .


1. Write a program to read mar:s rom :eyboard and your program should display e/ui$alent grade according to ollowing table. ;ar:s <rade 188'78 %istinction 18'64 3irst class 3-'-4 (econd class 8'3" 3ail 2. Write a program or (olution o /uadratic e/uation 3. ;a:e (imple 2alculator using switch and i =else i ". 3ind ma>imum and minimum o three numbers using ternary operator. -. 2hec: i the gi$en year is leap year or not. ( ?se ull condition or leap year ) 1. 2on$ert the case o a gi$en character ( i.e. upper to lower @ $ice $ersa ) ( ?se getchar @ putchar ) 6. 3ind ma>imum * minimum o 3 numbers using i and also using the #ernary operator. 7. Write a program to ind out Aet salary! H9.! %.! P, o employee according to Basic salary. %o using i and also using switch statements. Aet salary&Basic0H9.0%.0P, Basic salary H9. %. C& 18!888 28D 1-D C& -!888 and E 18!888 E -888 18D -D ' P, 18D 1-D

18D

-D

4. Write a program that will allow computer to be used as an ordinary calculator. 2onsider only common arithmetic operations.(0! '! 5! * ) #he program should display a menu showing the di erent options a$ailable. %o using i and also using switch statements. 18. #he cost o one type o mobile ser$ice is 9s. 2-8 plus 9s. 1.2or Fach call made o$er and abo$e 188 calls. Write a program to read 2ustomer codes and calls made and print the bill or each customer.

SET !:Write a C program "sing for, w ile # $o-w ile loop.


1. Write a program to Print 1st A natural numbers @ calculate their sum @ a$g. 2. Write a program to Print s/uares * cubes o 1st A natural numbers @ calculate their sum @ a$g. 3. Write a program to Print all numbers between 'n @ 0n. ". Write a program to Print 1st A odd * e$en numbers @ calculate their sum @ a$g. -. Write a program to Print all numbers between gi$en two numbers > @ y including > @ y! @ calculate their sum @ a$g. 1. Write a program to print all odd*e$en numbers between gi$en two Aumbers > @ y including > @ y! @ their sum @ a$g. 6. Write a program to print e$ery third number beginning rom 2 until Aumber E 188! @ calculate their sum @ a$g. 7. Write a program to print all numbers e>actly di$isible by - until number E 188! @ calculate their sum @ a$g. ?se modulus operator to chec: %i$isibility. 4. Write a program to Print the ollowing seriesG '1-! '18! '-! 8! -! 18! 1-. 18. Write a program to Print the $alue o the ollowing series G '1! >! '>2! >3! '>"! ..... 11. Write a program to Print the $alue o the ollowing series G sin>! sin2>!sin3>! sin">!........sin n>. 12. Write a program to Print the multiplication table o gi$en number H until n! in the 3ollowing ormatG H > 1 & H 13. Write a program #o calculate the power o a number i.e. >y or >n without using pow() unction 1". Write a program to 2alculate the actorial o a number. 1-. Write a program to Print all letters o the alphabet in upper @ lower case. 11. Write a program to Print all characters between gi$en 2 numbers > @ y. 16. Write a program to Print 1st A numbers o the 3ibonacci series. 17. Write a program to 2hec: i the gi$en number is prime or not. 14. Write a program or 1'>0>2*2I'>3*3I 0>"*"I=>n*nI terms.

SET % : Write a C program for following Pattern.. 1 12 12! 12!% 1 22 !!! %%%%

1 121 12!21 12!%!21

&'() *E+ ,C 1 .1 .1. 1.1.

SET / : Write a C program "sing an -00-12.


1.Write a program to read A integers and print A integers ?sing an array. 2.Write a program to ind the smallest and largest number in an array o A integers. 3.Write a program to arrange an array o A elements into ascending order. ".Write a program to read the mar:s o one subJect o 28 students and compute the number o students in categories 3.,K! P.((! 3,9(# 2K.(( and %,(#,A2#,LA. -.Write a program to insert $alue at ith location or $alue entered by user using one dimensional array. 1.Write a program to delete $alue at ith location or $alue entered by user using one dimensional array. 6.Write a program to add two 353 matrices! i . and B both are 353 matrices then resultant matri> 2&.0B where 2iJ&.iJ0BiJ using #wo' dimensional array. 7.Write a program to chec: whether gi$en 353 matri> is magic s/uare or not. Aote G . s/uare matri> is called magic s/uare i the sum o its all rows! columns and diagonal are e/ual.

SET 3 4 Write t e following programs for String 5peration..


1) Write a program to read string rom user and print the lenght o the string 2) Write a Program to re$erse a string 3) Write a program to chec: whether gi$en string is palindrome string or not ") Write a program to read your name and ouput the ascii code o the irst character representing your name -) Write a program to print each word o the gi$en string into seperate line 1) Write a program to count number o words in a gi$en string 6) write a program to count number o occurence o a gi$en character in a gi$en string.

SET - 6 Write t e 7elow program using functions..

1. 2. 3. ".

Write a program to ind number is odd or not. Write a program to ind out actorial o gi$en number using unction. Write a program to generate series >!>2!>3........>n Write a program to ind ma>imum o three numbers.

SET- 8 Write t e 7elow program using Structure..


1. Write a program to reads student roll number!student name.student mar:s o - subJects and prints student in ormation on screen. Write a program which de ine a structure data type called timeMstruct containing three members integer Hour! integer ;inute and integer (econd. %e$elop a program that would assign $alues to the indi$idual memebers and display the time in the olowwing ormG 11G"8G-1

2.

3.

Write a program which de ine a structure that can describe a hotel. ,t should ha$e members that includes the name! address! grade! a$erage room charge and number o rooms. #he program should per orm ollowing operation 1) #o print out hotels o a gi$en grade in order o charges. 2) #o print out hotels with room charges less then the gi$en $alue

". Write a program to read student roll number!name and maths mar:s or 3 students and prints student name and rollno i the mar:s are e/ual on screen.

SET - 9 Write t e 7elow program using C Pointer2


1. 2. 3. ". Write a program to print the address o a di erent datatype Write a program using pointer to read in a array o integers Write a program that compares two integer arrays to see Write a program to sort the array in ascending*descending

$ariables along with its $alue. and print its elements in re$erse order whether they are identical. order using pointers

SET- 1. Write t e 7elow program using C:: ;anguage..


1. Write a program in 200 which read name! age o student using class and display it. 2. ,mplement a 200 program using scope resolution operator. (#he program should declare three $ariable with same name! one should be global and the rest two should be declared in two di erent bloc:s.) 3. write a program in 200 to swap two $aribles using unction(call by re ernce. ". Write a program in c00 to calculate the area o triangle using inline unction. -. Write a program in c00 to calculate the $olume o cube!cylinder!rectangle using unction o$erloading. 1. Write a program in c00 to calculate actorial using riend unction(.lso use constructor).

You might also like