Programming in C

  • By
  • October 1, 2021
  • C & C++

Topic : Basic Programs

  1. Demonstrate “Hello World” Program in C using Code Blocks.

#include<stdio.h>

int main()

{

printf(“Hello World”);

return 0;

}

For Free, Demo classes Call: 8237077325
Registration Link: Click Here!

 

  1. How to calculate Simple interest In C.

#include<stdio.h>

int main()

{

int n,p,r;

double si;

printf(“Enter Principal Amount := “);

scanf(“%d”,&p);

printf(“Enter Rate of Interest := “);

scanf(“%d”,&r);

printf(“Enter Number of Years := “);

scanf(“%d”,&n);

si=(n*p*r)/100;

printf(“Simple Interest is := %f”,si);

return 0;

}

  1. Find out area of the Square and Rectangle.

#include<stdio.h>

int main()

{

int side,len,bre,s_area,r_area;

printf(“Enter Side for Recangle := “);

scanf(“%d”,&side);

s_area=side*side;

printf(“Enter Length for Rectangle := “);

scanf(“%d”,&len);

printf(“Enter Breadth for Rectangle := “);

scanf(“%d”,&bre);

r_area=len*bre;

printf(“Area of Square is := %d\n”,s_area);

printf(“Area of Rectangle is := %d”,r_area);

return 0;

For Free, Demo classes Call: 8237077325
Registration Link: Click Here!

 

}

  1. How to convert Fahrenheit temp in degree Celsius.
  2. Illustrate the use of Arithmatic Operators.
  3. Accept three numbers from user and find out greatest among them using conditional operator.
  1. How to Swap two numbers with third variable, and without third variable.
  2. 8.Calculate otal and average of the five subjects marks.
  1. How to calculate speed for time and distance.

Speed=(distance/time)

  1. How to write command line program to find reverse of a number.

Topic : Selection statement

 

  1. Demonstrate the use of %(modulus) operator to check a number is even or odd.
  2. Check eligibility of a person for voting .
  3. Enter Cost Price and ask whether the user is a student or not. 

     student and cost price is greater than 500, give discount of 10% 

ELSE discount will be 5%. 

     student and cost price is greater 500 then give discount of 8% ELSE discount will be 2%. 

(Take all inputs from USER)

  1. Accept Percentage from user and check the GRADE
  2. Above 70% – Grade A
  3. Between 60% to 70% – Grade B+.
  4. Between 45% to 60% – Grade B.
  5. Between 35% to 45% – Grade C.
  6. Less than 35% – Fail

 

  1. How to compare three numbers and find out largest number among three and also find out whether that three numbers are equal or not.(else if ladder) . Learn more at C and C++ Classes in Pune.

For Free, Demo classes Call: 8237077325
Registration Link: Click Here!

 

Topic : Branching statement

 

  1. According to the given menu Excecute the program

1: Reverse No.

2: Factorial NO.

3: Armstrong No.

4: Fibbonacci Series.

If user enters wrong choice appropriate message should get displayed.

  1. Demonstrate switch case for arithmetic operation on two numbers,

i.e. + is for addition

– is for subtraction

 

Topic : Looping statements

 

  1. How to check whether a number is prime or not.
  2. Calculate sum of even digits from given number.
  3. Using Nested for print the following pattern :

*

***

*****

*******

*********

  1. Using Nested for print the following output using jumping statements

1 5

2 4

4 2

5 1

  1. WAP to print

1 1 1 2

3 2 2 2

3 3 3 4

 

  1. GCD of three numbers
  2. WAP to print

1

1 1

1 0 1

1 0 0 1

1 1 1 1 1

  1. WAP to convert decimal to binary /binary to octal

 

Topic : Functions

 

  1. Use all four categories of functions for volume of the cylinder

(volume of cylinder: 3.14*r*r*h)

  1. a) Function without parameters without return value.
  2. b) Function with parameter without return value.
  3. c) Function without parameter with return value.
  4. d) Function with parameters with return value.

 

  1. How to calculate factorial of a number using a function. (using recursion)
  2. WAP to print Fibonacci series.(also using recursion)
  3. How to check whether a number is Armstrong number.
  4. How to check whether a number is palindrome.
  5. WAP to find HCF and LCM of given number using recursion.

 

Topic : Pointers

 

  1. Write a program that declares a double, an int, and char variables. Next declare and initialize apointer to each of the three variables. Your program should then print the address of, and value stored in. Read more at C and C++ Course in Pune.
  1. Demonstrate addition of two floating type numbers by using call by address.
  2. Demonstrate pointer arithmetic by assigning pointer “ptr” to variable “a” which is
  3. 4Lab Manual having value as 100 in it.Perform increment operation on pointer ptr like ptr=ptr+2 and display which address that pointer ptr hold. Read more at C and C++ Training in Pune.

 

Topic : Array

  1. How to all elements of an array.
  2. Howto sort array in ascending order.
  3. How to find greatest and smallest number in an array.
  4. WAP to find transpose of matrix
  5. WAP to multiply a 3*3 matrix.
  6. How to check whether a matrix is upper trianglular or lower triangular.
  7. Write a program to search particular value in an array and return the index number where it

is located.

  1. Perform following operations on two matrices with order m*n and p*q.
  2. Addition of two matrix
  3. Multiplication of two matrix
  4. WAP to check whether two matrtices are identical or not.
  5. Write a program to print all the LEADERS in the array. (An element is LEADER if it is greater

than all the elements to its right side.)

  1. Sort array using bubble sort

 

Topic : String

  1. WAP to compare two strings using strcmp ().
  2. WAP to concatenate two strings without using library function.
  3. WAP to convert upper-case string into lower-case and vice versa .Write your own

functions for the same.

  1. Find a character(or sub-string) in a string without using library function. And print its ascii

Author:- Jyotsna Binjwe

Call the Trainer and Book your free demo class for now!!!

© Copyright 2020 | Sevenmentor Pvt Ltd.

Submit Comment

Your email address will not be published. Required fields are marked *

*
*