Please select a subject first
Advertisements
Advertisements
WAP to print following pattern for n lines. [Note: range of n is 1-9]
1
121
12321
1234321
Concept: Data Input and Output in C-Programming
WAP to print binary equivalent of entered decimal no.
Concept: Data Input and Output in C-Programming
Write the output of following code:
#include<stdio.h>
int main()
{
int val = 1;
do{
val++;
++val;
}while(val++>25);
printf(“%d\n”,val);
return 0;
}
Concept: Control Structures >> Looping
Write a program to validate whether accepted string is palindrome or not.
Concept: Control Structures >> Looping
Write a program to find transpose of matrix without making use of another matrix.
Concept: Control Structures >> Looping
Define structure consisting of following elements
1. student roll_no
2. student name
3. student percentage
Write a program to read records of 5 students of and display same.
Concept: Control Structures >> Looping
Write a program to implement calculator with following operations using switch case
1. add two numbers
2. subtract two numbers
3. multiply two numbers
4. divide two numbers
Concept: Control Structures
Write a program to generate following patterns.
1. 1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
Concept: Control Structures >> Nested Control Structure
Write a program to generate following patterns.
1
2 3
3 4 5
6 7 8 9
Concept: Control Structures >> Nested Control Structure
Explain switch case and if-else ladder with example.
Concept: Control Structures >> Branching
Explain break and continue statement with example.
Concept: Control Structures >> Nested Control Structure
State True or False with reason.
while(0); is an infinite loop.
Concept: Control Structures >> Looping
Explain Nested Structure. Write a program using nested structure to create an Array of structure to store the details of N students.
The details are,
1. Student name
2. Student roll no
3. Marks of Physics, Chemistry, Maths.
Calculate total of P-C-M. Display the data in the format
Name Roll no Total marks
Concept: Control Structures >> Nested Control Structure
WAP to print the sum of following series.
1+22+33+………+nn
Concept: Control Structures >> Looping
Compare the following
break and continue statements
Concept: Control Structures >> Nested Control Structure
Compare the following
if-else and switch statements
Concept: Control Structures >> Nested Control Structure
Write a program to perform matrix multiplication by passing input matrix to the function and printing resultant matrix.
Concept: Control Structures >> Looping
Write a program to display following pattern:
1
232
34543
4567654
567898765
Concept: Control Structures >> Looping
An electronic component vendor supplies three products: transistors, resistors and capacitors. The vendor gives a discount of 10% on order of transistor if the order is more than Rs. 1000. On order of more than Rs. 100 for resistors, a discount of 5% is given and discount of 10% is given on order for capacitors of value more than Rs. 500. Assume numeric code 1, 2 and 3 used for transistors, capacitors and resistors respectively. Write a program that reads the product code and order amount and prints out the net amount that the customer is required to pay after discount. (Note: Use switch-case)
Concept: Control Structures >> Nested Control Structure
Write a program to print following patterns for N lines.
5 4 3 2 *
5 4 3 * 1
5 4 * 2 1
5 * 3 2 1
* 4 3 2 1
Concept: Control Structures >> Nested Control Structure
