0% found this document useful (0 votes)
67 views

General Programs2

The document contains programming problems divided into different categories like general programs, if conditions, nested if, switch case, loops (for, while, nested for), arrays. It asks to write programs that take input, perform specified operations and conditions on the inputs and produce expected outputs. It provides over 100 problems across these categories for practice in C programming. The problems cover basic to advanced concepts like pattern printing, series generation, searching, sorting, factorization etc. It also specifies that the input/output details must be provided for the problems.

Uploaded by

xafan39947
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
67 views

General Programs2

The document contains programming problems divided into different categories like general programs, if conditions, nested if, switch case, loops (for, while, nested for), arrays. It asks to write programs that take input, perform specified operations and conditions on the inputs and produce expected outputs. It provides over 100 problems across these categories for practice in C programming. The problems cover basic to advanced concepts like pattern printing, series generation, searching, sorting, factorization etc. It also specifies that the input/output details must be provided for the problems.

Uploaded by

xafan39947
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 26

II-Floor, Sri Sai Arcade, Beside: Adithya Trade Center, Ameerpet, Hyderabad-500038.

Ph: 040-65538958/68/78

General programs:

1. Write a program add two numbers


2. Write a program input two numbers and interchange those values.
3. Write a program input two numbers and interchange those values without using 3 rd
variable.
4. Write a program input feet and converted into inches
5. Write a program input sno,sname,m1,m2,m3 and find out total and avg marks.
6. Write a program input eno, ename,bs,hra,da,pf and tax . find out gross and net salary.

If Condition:

1. Write a program input two numbers and find out the biggest number.
2. Write a program input three numbers and find out the biggest number.
3. Write a program input any number and check it is positive or negative
4. Write a program input any positive number and check it is even or odd
5. Write a program input any positive number and check it is even or odd without using %
symbol
6. Write a program input acno , name, current balance, transaction amount, transaction
code(d/w) calculate net balance.
7. Write a program input cno, cname,srno,erno,slab type(i/c/r) calculate units consumed
Conditions: if slab type is industry then unit rate is 5/-
If slab type is commercial then unit rate is 4/-
If slab type is residence then unit rate is 3/-
Calculate total bill.
8. Write a program input eno,ename,sal,designation(m/a/c) .
If designation is manager then bonus is 20% on his salary
If designation is analyst then bonus is 10% on his salary
If designation is clerk then bonus is 5% on his salary
Calculate totsal
9. Write a program input sno,sname,tm.
If tm>360 then print ‘First class’ If Tm>=300 and tm<360 then print ‘second class’
If tm<300 then print ‘third class’

Nested if:
1. Write a program input cno, cname,srno,erno,slab type(i/c/r) calculate units consumed

Conditions: if slab type is industry and units consumed <=100 then unit rate is 5/-
Else 6/- If slab type is commercial and units consumed <=100 then unit rate is 4/-
Else 5/- If slab type is residence then unit consumed <=100 then unit rate is 3/-
Else 4/- Calculate total bill.

Switch case:

1. Write a program input acno , name, current balance, transaction amount, transaction
code(d/w) calculate net balance.
2. Write a program to input any number from 1 to 10 and print in words.
3. Write a program to input any number from 1 to 100 and print in words.

Loops

For loop:

1. Print satya technologies 10 times


2. Print 1 to 10 numbers
3. Print even numbers from 1 to 10
4. Print odd numbers from 1 to 10
5. Print sum of all the numbers 1 to 10
6. Print sum of all even numbers from 1 to 10
7. Print sum of all odd numbers from 1 to 10
8. Find the factorial of a given number
9. Check the number is prime or not
10. Print the number from 10 to 1
11. Input any 10 numbers find out no of even numbers and no of odd numbers
12. Input any 1o numbers find out no of positive numbers and no of negative numbers
13. Input any 10 numbers find the first biggest and second biggest number
14. Input any 10 find number of prime numbers.
15. Input any 4 digit number and reverse it
16. Input any 4 digit number and find out the sum of the digits
17. Input any 4 digit number and find out the sum of first and last digit
18. Input any 4 digit number and find out the sum of middle digits
19. Input any 4 digit number and find out the difference of all digits
20. To generate Fibonacci series
Nested for loop

1 . print the following triangle

1 2

1 2 3

1 2 3 4

1 2 3 4 5

2. print the following triangle

1 2 3 4 5

1 2 3 4

1 2 3

1 2

3. print the following triangle

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

4. print the multiplication tables upto 20

5. print the following triangle

1 1

1 2 2 1

1 2 3 3 2 1

1 2 3 4 4 3 2 1
6. program to print

a b c d e f g f edcba
a b c d e f f edcba
a b c d e edcba
a b c d dcb a
a b c cb a
a b b a
a a

7. Program to find all prime number between a given range

While loop:

1. Print numbers from 1 to 10

2. Print numbers from 10 to 1

3. Print numbers from even numbers from 1 to 10

4 Input any number check it is strong or not

5. Input any number check it is palindrome

6. Input any number check arm strong or not

7. Input any number perfect number or not.

8. Program to find number of times digit appears in the given number.

9. Program to convert bin number to decimal number.

Arrays:

1. Program to find the sum of all numbers in the array.


2. Program to print only those numbers which are ending with 0
3. Program to find max and min values along with positions
4. Program to find second largest in the array.
5. Program for linear search
6. Program for binary search
7. Program to find the number of times a digit appears in a given number.
8. Program to create array 1 to 100 find all multiples of each number and make them 0. Print non
zero values.
9. Program to find frequency of each number
10. Program to reverse array values
11. Program to find common values between two arrays and count.
12. Program to perform bubble sort
13. Program to perform selection sort
14. Program to combine two arrays in a single array in ascending order
15. Program to remove duplicate values in the array.

**Please give the all kinds of inputting values and what you expected as output must be specified. **

1. Write a program to generate the first 50 terms of Fibonacci series and print their sum and
average. E.g : 1 1 2 3 5 8 13 21 34 ……..
2. Write a program to find the sum of the series 1 - 1/2 2 + 1/32 – ¼2 + 1/52 - 1/62 + …….

3. Write a program to find the roots of quadratic equation.


(ax2+bx+c=0 discriminate is b2 – 4*a*c roots are (-b±√ b2 – 4*a*c )/(2*a)
4. Write a program for sin(x) series. Input x and the number of terms and determine sin(x). x
- x3/3! + x5/5! - x7/7! + x9/9! - x11/11! …..+ (-1)n+1x2n-1/(2n-1)! + …. ! is Factorial

5. Write a program that prints the following pattern using for loops.

10 9 8 7 6 5 4 3 2 1 0

10 9 8 7 5 3 2 1 0

10 9 8 5 2 1 0

10 9 5 1 0

10 5 0

6. Write a program to find common positive factors of a two numbers.


(e.g : 18 factors are 1, 2, 3, 6, 9, and 18 15 factors are 1 3 5 15 common are 1 3)

7. Write a program to accept a,b,c and print in ascending order.

8. Write a program to find GCD(greatest common divisor) or HCF (highest common factor)of two
numbers.
p. Gcd(a,b) = (a*b) / lcm(a,b)

q. Gcd(a,0) = a
Gcd(a,a) =a
Gcd(a,b) = gcd(a-b,b) if b < a
Gcd(a,b) = gcd(a,b-a) if a < b

9. Write a program to convert decimal to binary numbers.

10. Write a program to convert binary to decimal numbers

11. Write a program to find the LCM of two numbers.

12. Write a program to print Pascal triangle.

1 1

1 2 1

1 3 3 1

1 4 6 4 1

1 5 10 10 5 1

1 6 15 20 15 6 1

13. Write a program to convert decimal to octal and Hexadecimal numbers and vice versa.

14. Write a program for given pattern

1 2 3 4
12 13 14 5
11 16 15 6
10 9 8 7

15. Write a program for given pattern.


1
0 1
1 0 1
0 1 0 1
1 0 1 0 1
0 1 0 1 0 1
1 0 1 0 1 0 1
16. Write a program to check whether a given number is a palindrome number.

17. Write a program to swap two numbers without using a temporary variable.
18. Write a program in C to print “Hello World” without using semicolon anywhere in the
code.

19. Write a program in C to print a semicolon without using a semicolon anywhere in the
code.

20. Write a program to count the number of times the largest digit occur in a number.
e.g:- 22699 largest digit is : 9 no of occurrence is : 2

C programming codes
 Hello world
 Addition

 Odd or Even

 Add, subtract, multiply and divide

 Check vowel

 Leap year

 Add digits

 Factorial

 HCF and LCM

 Decimal to binary conversion

 ncR and nPr

 Add n numbers

 Swapping

 Reverse number

 Palindrome number

 Diamond

 Prime numbers

 Find armstrong number

 Generate armstrong number

 Fibonacci series

 Print floyd's triangle


 Print pascal triangle

 Maximum element in array

 Minimum element in array

 Linear search

 Binary search

 Reverse array

 Insert element in array

 Delete element from array

 Merge arrays

 Bubble sort

 Insertion sort

 Selection sort

 Add matrices

 Subtract matrices

 Transpose matrix

 Multiply two matrices

 Print string

 String length

 Compare strings

 Copy string

 Concatenate strings

 Reverse string

 Reverse number

 Find palindrome

 Delete vowels

 Sort a string

 Remove spaces

 Change case
 Swap strings

 Character's frequency

 Random numbers

 Add complex numbers

 Print date

 Get IP address

 Shutdown computer

 Print Multiplication Table

 Swapping

 Largest of three integers

 Binary to Decimal
 Binary to Decimal,Octal,Hexadecimal

 Roman to Decimal

 Decimal to Binary

 Palindrome

 Binary to 2's complement

 GCD and LCM

 Fibonacci Numbers

 Find Quadrant

 Prime Number

 Complex Numbers

 Sum of Digits

 Swap Numbers

 Cos(x)

 Sin(x)
 X^N

 Polynomial Series

 ODD or EVEN

 nPr and nCr.

 Square and Cube

 Armstrong Number

 Perfect Number

 Random Number

1. Write a program to swap two variables without using a temporary variable.


2. What is the 8 queens problem? Write a C program to solve it?
3. Write a program to print a square matrix helically.
4. Write a program to reverse a string.
5. Write a program to reverse the words in a sentence in place.
6. Write a program generate permutations.
7. Write a program for calculating the factorial of a number.
8. Write a program to calculate pow(x,n)?
9. Write a program which does wildcard pattern matching algorithm.
10. How do you calculate the maximum subarray of a list of numbers?
11. How to generate fibonacci numbers? How to find out if a given number is a fibonacci
number or not? Write programs to do both.
12. Solve the Rat In A Maze problem using backtracking.
13. What Little-Endian and Big-Endian? How can I determine whether a machine’s byte
order is big-endian or little endian? How can we convert from one to another?
14. Write code to solve the Tower of Hanoi problem.
15. Write code to return a string from a function.
16. Write a program which produces its own source code as its output.
17. Write a progam to convert from decimal to any base (binary, hex, oct etc…).
18. Write code to check if an integer is a power of 2 or not in a single line?
19. Write a program to find the GCD of two numbers.
20. Write code to remove duplicates in a sorted array.
21. Find the maximum of three integers using the ternary operator.
22. How do you initialize a pointer inside a function?
23. Write code to dynamically allocate one, two and three dimensional arrays (using
malloc()).
24. How would you find the size of structure without using sizeof()?
25. Write a program to multiply two matrices.
26. Write a program to check for palindromes.
27. Write a program to convert a decimal number into a binary number.
28. Write code to implement the Binary Search algorithm.
29. Write code to evaluate a polynomial.
30. Write code to add two polynomials.
31. Write a program to add two long positive numbers (each represented by linked lists).
32. How do you compare floating point numbers?
33. What’s a good way to implement complex numbers in C?
34. How can I display a percentage-done indication on the screen?
35. Write a program to check if a given year is a leap year or not?
36. How to swap the two nibbles in a byte ?
37. How to scan a string till we hit a new line using scanf()?
38. Write pseudocode to compare versions (like 115.10.1 vs 115.11.5).
39. How do you get the line numbers in C?
40. How to fast multiply a number by 7?
41. Write a simple piece of code to split a string at equal intervals.
42. Is there a way to multiply matrices in lesser than o(n^3) time complexity?
43. How do you find out if a machine is 32 bit or 64 bit?
44. Write a program to have the output go two places at once (to the screen and to a file also).
45. Write code to round numbers.
46. How can we sum the digits of a given number in single statement?
47. Given two strings A and B, how would you find out if the characters in B were a subset
of the characters in A?
48. Write a program to merge two arrays in sorted order, so that if an integer is in both the
arrays, it gets added into the final array only once.
49. Write a program to check if the stack grows up or down.
50. How to add two numbers without using the plus operator?
51. How to generate prime numbers? How to generate the next prime after a given prime?
52. Write a program to print numbers from 1 to 100 without using loops.
53. Write your own trim() or squeeze() function to remove the spaces from a string.
54. Write your own random number generator function in C.
55. Write your own sqrt() function in C.

Frequently asked c programs in interview


1. Write a program to check given number is perfect number or not.

2. Write a program to check given number is Armstrong number or not.

3. Write a program to check given number is prime number or not.

4. Write a program to check given number is strong number or not.

5. program to check a number is odd or even.

6. Write a program to check given number is palindrome number or not.

8. Write a program to check given string is palindrome number or not.

7. Write a program to solve quadratic equation.


8.  Write a program to print Fibonacci series of given range.
9. Write a program to get factorial of given number.

10. Write a program for Floyd’s triangle.

11. Write a program to print Pascal triangle.

12. Write a program to generate multiplication table.


13. Write a program to print ASCII value of all characters.
14. program to print hello world without using semicolon
15. Write a program which produces its own source code as its output

C program with numbers

1. Write a program to reverse any number.


2. Write a program to find out sum of digit of given number.
3. Write a program to find out power of number.          

4. Write a program to add two numbers without using addition operator.

5. Write a program to subtract two numbers without using subtraction operator.

6. Write a program to find largest among three numbers using binary minus operator.

 7. Write a program to find largest among three numbers using conditional operator

8. Write a program to find out generic root of any number.

9. Write a program to find out prime factor of given number.

10. Write a program to find out NCR factor of given number.


11. How to convert string to int without using library functions in c
12. Program to print 1 to 100 without using loop
13. program for swapping of two numbers
14. Program to find largest of n numbers in c
15. Split number into digits in c programming
16. program to count number of digits in a number
Recursion
Example of recursion in c programming

L.C.M and H.C.F.

1.  Write a program to find out L.C.M. of two numbers.

2. Write a program to find out H.C.F. of two numbers.

3. Write a program to find out G.C.D. of two numbers.

Swapping

1. Write a program to swap two numbers.

2. Write a program to swap two numbers without using third variable.

3. Write a program for swapping of two arrays.

4. Write a program for swapping of two string.

Conversion ( Number System )

1. Write a program to convert decimal number to binary number.

2. Write a program to convert decimal number to octal number.


3. Write a program to convert decimal number to  hexadecimal number.
4. Write a program to convert octal number to binary number.

5. Write a program to convert octal number to decimal number.

6. Write a program to convert octal number to hexadecimal number.

7. Write a program to convert hexadecimal number to binary number.

8. Write a program to convert hexadecimal number to octal number.


9. Write a program to convert hexadecimal number to decimal number.
10. Write a program to convert binary number to octal number.

11. Write a program to convert binary number to decimal number.

12. Write a program to convert binary number to hexadecimal number.


13.  program for addition of binary numbers . 
14. program for multiplication of two binary numbers.
15.  program fractional binary conversion from decimal.
16.  program for fractional decimal to binary fraction conversion.
17. program to convert decimal number to roman.
18. program to convert roman number to decimal number.
19. program to convert each digits of a number in words
20. program to convert currency or number in word.
Conversion ( Unit )

1. program for unit conversion.

String

1. Write a program to convert the string from upper case to lower case.

2. Write a program to convert the string from lower case to upper case.

3. Write a program to delete the all consonants from given string.

4. Write a program to count the different types of characters in given string.

5.  Write a program to sort the characters of a string.

6. Write a program for concatenation two strings without using string.h header file.

7. Write a program to find the length of a string using pointer.  

8. Write a program which prints initial of any name.

9. Write a program to print the string from given character.


10. Write a program to reverse a string
11. Reverse a string using recursion in
12. String concatenation in c without using strcat
13. How to compare two strings in c without using strcmp
14. String copy without using strcpy in c
15. Convert a string to ASCII in c

Matrix

1. Write a program for addition of two matrices.

2. Write a program for subtraction of two matrices

3. Write a program for multiplication of two matrices.

4. Write a program to find out sum of diagonal element of a matrix.

5. Write a program to find out transport of a matrix.


6. Write a program for scalar multiplication of matrix.
7. program to find inverse of a matrix
8. Lower triangular matrix
9. Upper triangular matrix
10. Strassen's matrix multiplication program
11. program to find determinant of a matrix
Complex number

1. Complex numbers program in c

2. Write a program for addition and subtraction of two complex numbers.

3. Write a program for multiplication of two complex numbers.

4. Write a program for division two complex numbers.

Series

1. Write a program to find out the sum of series 1 + 2 + ….  + n.

2. Write a program to find out the sum of series 1^2 + 2^2 + …. + n^2.

3. Write a program to find out the sum of series 1^3 + 2^3 + …. + n^3.

4. Write a program to find out the sum of given A.P.

5. Write a program to find out the sum of given G.P.

6. Write a program to find out the sum of given H.P.

7. Write a program to find out the sum of series 1 + 2 + 4 + 8 … to infinity.

Array

1. Write a program to find out largest element of an array.

2. Write a program to find out second largest element of an unsorted array.

3. Write a program to find out second smallest element of an unsorted array.

4. Write a program which deletes the duplicate element of an array.

5. Write a program for delete an element at desired position in an array.

6. Write a program for insert an element at desired position in an array.


7. program to find largest and smallest number in an array

Sorting

1. Write a program for bubble sort.

2. Write a program for insertion sort.

3. Write a program for selection sort.

4. Write a program for quick sort.


5. Write a program for heap sort.

6. Write a program for merge sort.

7. Write a program for shell sort.

Recursion

1. Write a program to find factorial of a number using recursion.

2. Write a program to find GCD of a two numbers using recursion.

3. Write a program to find out sum digits of a number using recursion.

4. Write a program to find power of a number using function recursion.

5. Write a program to reverse any number using recursion.

Size of data type

1. Write a program to find the size of int without using sizeof operator.

2. Write a program to find the size of double without using sizeof operator.     

3. Write a program to find the size of structure without using sizeof operator.

4. Write a program to find the size of union without using sizeof operator.

Searching

1. Write a program for linear search.

2. Write a program for binary search.

3. Write a program for binary search using recursion.

Area and volume

1. Write a program to find the area of circle.

2. Write a program to find the area of any triangle.


3. Write a program to find the area of equilateral triangle.
4. Write a program to find the area of right angled triangle .

5. Write a program to find the area of rectangle.

6. Write a program to find the area of trapezium.     


7. Write a program to find the area of rhombus.   
8. Write a program to find the area of parallelogram.           
9. Write a program to find the volume and surface area of cube.
10. Write a program to find the volume and surface area of cuboids.
11. Write a program to find the volume and surface area of  cylinder.

12. Write a program to find the surface area and volume of a cone.
13. Write a program to find the volume and surface area of sphere.

14. Write a program to find the perimeter of a circle, rectangle and triangle.

C program with very large numbers

1. Write a program to find factorial of 100 or very large numbers


2. Write a program to multiply the two very large number (larger the long int)
3. Write a program for division of large number (larger than long int)
4. code for modular division of large number.
5. code for division of large number.
6. code for power of large numbers.

Other

1. program for ATM transaction.

2. Write a program which passes one dimension array to function.

3. Write a program which passes two dimension array to function.

4. Write a program which takes password from user.

5. Write a scanf function in c which accept sentence from user.

6. Write a scanf function in c which accept paragraph from user.

7. Write a program to print the all prime numbers between 1 to 300.


8. Write a program which passes structure to function.
9. Palindrome in c without using string function
10. How to get the ASCII value of a character in c
11. C program to get last two digits of year
12. C program without main function

 2d example insertion sort


 A bubblesort routine

 A simple example showing some comparison operators


 Add numbers using command line arguments (CLA)

 Add Pointers

 Add two matrices and store the result

 Addition of Two Matrices

 Addition of two numbers in C++

 Area and Perimeter of Rectangle

 Area and Perimeter of Square

 Area of Circle

 ARRANGE THE ELEMENTS IN ARRAY IN DESSENDING ORDER

 ATM programing

 Basic example showing constants usage in C

 below and average students

 Binary search

 Bubble sort - linked list

 bubble sort -2

 Bubble sort in string array

 C Program find Positive Negative with Switch Case Without Conditional Operator

 C Program to calcuate interest and total amount at the end of each year

 C++ Programs

 Calculate Average of Four Numbers in C++

 Calculate bill with discount in C++

 Calculate Electric Energy Bill

 Calculate Electricity Bill with if-else condition

 calculate the power in watts

 Calculate the Sum

 Check Leap Year in C++

 Check Odd or Even Number in C++

 Concatenate Two Strings


 Construct Pyramid of Numbers

 Convert Decimal to Hexadecimal Number

 Convert Roman Numeral to Decimal

 Copy One File to Another

 Count no. of students above

 count occurrences of values in an array.

 Count the array elements

 Decimal to Binary Conversion

 Deleting Element In An Array

 Determine Palindrome String

 dynamic pointer array

 Example of Using Strings in C

 Facebook Page

 Factorial Function In C

 Factorial of Number Using While Loop

 Factorial off a number using "do while" loop

 Factorials with Recursive Non Recursive

 Fibonacci Series using Recursive Function

 find a given number is positive or negative number in C without if statement

 Find address of char

 Find Area of Rectangle in C++

 Find Greater between two numbers in C++

 Find Inverse of a Given Matrix

 Find Maximum Value in Array

 FIND THE SUM OF DIGIT THREE Numbers

 Generate Pascal's Triangle

 Greatest Common Divisor (GCD) - Recursive Non Recursive

 Greatest of two Numbers - Conditional Operator


 Hanoi Problem Recursive and Non Recursive Functions

 heap sort

 History Of C

 how 2 find a given number is positive or negative number in C without using relational and
conditional operator

 Hsort

 INORDER .

 Inserting Elements In An Array

 insertion sort

 Insertion sort in linked list

 integer

 Integer Operands Result

 Isort

 Largest and smallest number Integers

 Length of string and show it in upper

 Linked List implementation

 lower and reverse order

 Mark list Analysis using Structures

 Matrix Multiplication

 Menu Driven Calculator

 Merge sort - linked list

 Merging The Elements In An Array

 Msort Merge sort

 Multiplication of Two Matrices

 Multiply and Division of two numbers

 Multiply and swap 2 nmbers using bitwise operators

 Ohms law example In C

 Print 1 to 10 Series
 Print a double pyramid

 Print all permutations of a given string

 Print Armstrong No.S Less Than 1000

 Print Second Largest Among Given Three No.S

 Progam that gives length of side of a Triangle

 Program for conversion of Decimal to Roman Number

 Program for demonstration of Tree Operations - INSERTION

 Program for finding the transpose of a martix in sparse form

 Program for rotating circles using maths Function

 PROGRAM TO ARRANGE THE ELEMENTS IN ARRAY IN ASSENDING ORDER

 program to calculate sum all of the elments in an array

 Program to compute difference between two dates

 Program to construct a pyramid of any input numbers

 program to find greatest of 2 numbers without using relational and conditional operators

 Program to find whether a number is odd or even

 Program to Open a file

 Pyramid using nested for loops

 Qcksort

 Qserch

 quick sort

 Quick Sort : array of pointers to structures

 read a file and write to a file

 relational and conditional operator

 Reverse First Letter characters

 Reverse Floyds Triangle

 Reverse words in a String C Program

 reversing a linked list

 Search an array
 Search An Element in Linked List

 SEARCHING OF THE ELEMENTS OF BINARY NUMBER

 Searching the Element in an Array

 selection sort in array

 Selection sort linked list

 shell sort array

 Shsort

 Sorting Strings in Ascending Order

 Square Root of a number by using simple calculations

 Ssort

 Standard Deviation using Function

 string

 String array Qsort

 Sub String Given Main String Position

 Substring Replacement

 Subtract

 Subtraction of Two Matrices

 the Swapping of two Values using Functions

 This program calculates an average of the numbers entered

 To delete n Characters from a given position in a given string

 Total Number of Consonants in a String

 Treesort - string array

 Use of Strlen() Function

 Volume of Box in C++

 WAP to add 1 and subtract 1 from value of a and b (Incremental / Decremental Operators)

 WAP to add entered three digits

 WAP to add two variables

 WAP to concatenate two strings


 WAP to Convert CELCIUS to fahrenheit

 WAP to count number of vowels

 WAP to create double dimension array of 2x3 matrix and display its Elements

 WAP to enter character by using getch ( ) function

 WAP to enter records and also repeat the step if user wants to continue

 WAP to find amount of given quantity of any company with 10% discount using switch case

 WAP to find if number=10 then Good else Bad

 WAP to find out Bigger and Equal number from three numbers (Ternary Operators)

 wap to find out bigger number (if-else)

 WAP to find out Bigger number from two numbers (Ternary Operators)

 WAP to find out Even or Odd number (IF-ELSE)

 WAP to find out Positive or Negative (IF-ELSE)

 WAP to find out power of any number

 WAP to find out Quardratic Equation (d=b2-4ac)

 WAP to find out Square root of any number

 WAP to find out Total Bill with discount according to conditions (Ternary Operators)

 WAP to find out total marks and Percentage of three subjects

 WAP to find out total marks of three subjects

 WAP to find out TOTAL SALARY with (IF-ELSE)

 WAP to find out Year is leap or not (IF-ELSE)

 WAP to find size of any variable

 WAP to find string within a string

 WAP to find that number is palandrom or not (121=121)

 WAP to find that number is prime or not

 WAP to find the factorial of the number (1x2x3x4)

 WAP To find the GCD (greatest common divisor) of two given integers

 WAP to find the length of any string

 WAP TO PRINT ANY MESSAGE ON SCREEN


 WAP to print any name on screen 10 times

 WAP to print ASCII code from 0 to 255

 WAP to print Even and Odd numbers from 20 to 1

 WAP to print fabbonic series from 1 to 55

 WAP to print name and display on screen

 WAP to print numbers from 1-50 which are divided by 7

 WAP to print Odd numbers from 1 to 20

 WAP to print series from 1 to 10 and break on 5

 WAP to print series from 1 to 10 and find its square and cube

 WAP to print series from 1 to 10 and skip 5 and 7

 WAP to print series from 20 to 1

 WAP to print series from start to end using do-while loop

 WAP to print Stars on screen

 WAP to print table of 5

 WAP to print the detail of the programmer

 WAP to print value of multiple data types

 WAP to Reverse of any number using while loop

 Wap to reverse words

 WAP to Sum

 WAP to sum of five elements of an array

 WAP to SWAP the three digit number

 Whether the given no. is armstrong or not

 Whether the given no. Is palindrome or not

 Write a C program to find both the largest and smallest number in a list of integers

 write a c program to find prime numbers

 Write a C program to find the sum of individual digits of a positive integer

 Write a C program to generate all the prime numbers between 1 and n

 Write a C program to print all permutations of a given string


 Write a C program to reverse the words in a sentence in place.

 write a program to find the factorial of a number

 write c program to find the roots of a quadratic equation

 Write C program to implement Simpson method

 Write C Program to Print a Triangle

 XOR list example

18. #include <stdio.h>


int main() {
//printf returns the length of string being printed
if (printf(“Hello World\n”)) //prints Hello World and returns 11
{
//do nothing
}
return 0;
}
Output:
Hello World

#include<stdio.h>
int main(){
    int i;
    for(i=0;i<5;i++){
         int i=10;
         printf(" %d",i);
         i++;
    }
    return 0;
}
Output 10 10 10 10 10

You might also like