6
1.program output hello! welcome to c language ========================== ====================== 2. program output program to test even or odd enter a number 25 Odd Number ========================== ====================== 3. program output program to print natural numbers enter number 25 natural numbers are 0 1 2 3 4 5 " # 10 11 12 13 14 15 1 1 1" 1# 20 21 22 23 24 25 ========================== == 4. program output program to demonstrate switch statement 1. add 2. sub 3.mul select $our choice 1 enter two values 20 30 addition value is 50 ========================== ============= 5. program output program to %nd sum o& &actors 'nter a Number 25 (actors are 1 5 25 total sum is 31 ========================== =============== . program output program to %nd sum o& digits o& number enter number 145" the total sum is 1" ========================== ================ . program output program &or prime number enter number 1 given number is prime ========================== ============== ". program output program to generate prime numbers enter limit 20 prime numbers are 2 3 5 11 13 1 1# ==================== #. program output program &or per&ect number 1

projecet od

Embed Size (px)

DESCRIPTION

jgfj

Citation preview

1.program output

hello! welcome to c language

================================================ 2. program output

program to test even or odd enter a number 25 Odd Number ================================================ 3. program output

program to print natural numbers enter number 25 natural numbers are 0 12 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 2122232425

============================4. program output program to demonstrate switch statement 1. add 2. sub 3.mul select your choice1enter two values2030 addition value is 50

=======================================5. program outputprogram to find sum of factorsEnter a Number25Factors are1 5 25 total sum is 31

=========================================6. program outputprogram to find sum of digits of numberenter number1458the total sum is 18

==========================================7. program output program for prime numberenter number17given number is prime

========================================8. program outputprogram to generate prime numbersenter limit20prime numbers are2 3 5 7 11 13 17 19

====================9. program outputprogram for perfect numberEnter number6given number is perfect

============================10.program outputprogram to find factorial valueEnter Number5Factorial value is 120==============================11.program output

program for mathematical tableenter number 15 mathematical table is 15 * 1 = 15 15 * 2 = 30 15 * 3 = 45 15 * 4 = 60 15 * 5 = 75 15 * 6 = 90 15 * 7 = 105 15 * 8 = 120 15 * 9 = 135 15 * 10 = 150 ======================================12. program outputprogram of quatratic equationenter a,b,c values 1052The Roots are -0.250000 0.250000

==========================================13. program outputprogram reversing of a numberenter number1254given number is not polindrome==================14. program output

Program for string polindromEnter TextmadamGiven Text ismadam given text is poindromeReverse Text is madam============15. program outputprogram for armstrong Number Enter Number for armstrong 159 given number is not armstrong ==================================16. program output16.program outputprogram for with out parametersdisplaying message using functionThis is display function=================================17.program outputprogram for with out parametersdisplaying message using function This is display function output result 50=================================18. program outputprogram for sorting the arrayEnter array size 5 enter 5 elements20 4 30 50 15 Given Array is 20 4 30 50 15 Sorted Array is 4 15 20 30 50 ==================19. program outputprogram for matrix additionEnter Matrix a values a[1][1] = 1 a[1][2] = 1 a[1][3] = 1 a[2][1] = 1 a[2][2] = 1 a[2][3] = 1 a[3][1] = 1 a[3][2] = 1 a[3][3] = 1 Enter Matrix b values b[1][1] = 1 b[1][2] = 1 b[1][3] = 1 b[2][1] = 1 b[2][2] = 1 b[2][3] = 1 b[3][1] = 1 b[3][2] = 1 b[3][3] = 1 Result matrix is 2 2 2 2 2 2 2 2 2 ============================================ 20. program outputprogram for matrix subtractionEnter Matrix a values a[1][1] = 2 a[1][2] = 2 a[1][3] = 2 a[2][1] = 2 a[2][2] = 2 a[2][3] = 2 a[3][1] = 2 a[3][2] = 2 a[3][3] = 2Enter Matrix b values b[1][1] = 1 b[1][2] = 1 b[1][3] = 1 b[2][1] = 1 b[2][2] = 1 b[2][3] = 1 b[3][1] = 1 b[3][2] = 1 b[3][3] = 1Result matrix is111111111================================== 21. program outputprogram reversing of a numberenter number 145 reverse number is 541 ====================================22. program outputprogram for matrix multiplicationEnter Matrix a values a[1][1] = 2 a[1][2] = 2 a[1][3] = 2 a[2][1] = 2 a[2][2] = 2 a[2][3] = 2 a[3][1] = 2 a[3][2] = 2 a[3][3] = 2 Enter Matrix b values b[1][1] = 1 b[1][2] = 1 b[1][3] = 1 b[2][1] = 1 b[2][2] = 1 b[2][3] = 1 b[3][1] = 1 b[3][2] = 1 b[3][3] = 1 Result matrix is 0 0 0 6 4 4 10 8 8 ==================================23. program outputProgram for Swapping Numbers Before swapping a,b values are a=20 b=30after swapping a,b values are a=30 b=20======================================24. program outputprogram for structure demonstrationEnter data into structure id,name 20 raju structure data is 20 raju ========================================25. program outputprogram to demonstrate fputsFile Opened enter textthis is anil from ndc data stored sucess===============================26. program outputprogram for fgetsfile opened text is this is anil from ndc 00B0 file closed ============================27. program outputprogram to count number of words, linesEnter Text and end with $ Hi, this is anil from Computers Department welcome to c language $ Number of characters are : 66 Number of words are : 13 Number of lines are : 4 Number of special characters are : 0 ==============================28 a) program output program for mathmatical functions enter a number to find square root value 25 square root value is 5.000000 enter a number to find log value 5 2 log value is 1.609438 ======================================28 b) PROGRAM OUTPUTunion program enter std rno 25 student roll no is 25 enter std name RAJU student name is RAJU ====================================29 a. program outputunion program enter std rno 24 student roll no is 24 enter std name anil student name is anil =================================29b program outputprogram to demonstrate pointers enter a value 30 pointer variable value is 30 =================================30. program outputprogram to demonstrate enum data typesjan days=31 feb days=28 mar days=31 Apr days=30 may days=31 jun days=30 july days=31 aug days=30 sep days=31 nov days=31 dec days=30 ====================================31. program outputprogram for fibonacci seriesEnter Number 8 Fibonacci Series are 0 1 1 2 3 5 8 13 21 ===================================== 32. program outputprogram for dynamic memory allocation functions20 bytes memory allocated 20 bytes memory allocated enter text this c language Enter Another Text welcome Entered Data is this c language welcome Reallocating first string memory Enter text into str1 this is anil Entered Text is this is anil ===========================================33. program outputEnter three Numbers30 5060 Maximum Number is 60 =========================================34. program outputprogram for Maximum Numberenter Numbers 20 10 45 c is largest45 =============================================35. program outputEnter N and X values102Exponential Value is 0.042105=========================================36. program outputprogram for matrix traceEnter Matrix elements a[1][1]= 1 a[1][2]= 2 a[1][3]= 2 a[2][1]= 2 a[2][2]= 2 a[2][3]= 2 a[3][1]= 2 a[3][3]= 2 The Given Matrix is 1 2 2 2 2 2 1 5 2 Trace of Matrix is 5======================================37. program outputprogram for fprintffile opened 0data stored success file closed =====================================38. program outputfile opened successfullyfile closed successfully =============================39. program output

=======================40. program output40. program outputprogram for putc functionfile opened successfully, Enter data Enter E to exit welcome E Data stored success file closed ====================================41. program output program for getc functionfile opened successfully Data is welcome =============================== 3