Please select a subject first
Advertisements
Advertisements
Write a menu driven program to perform arithmetic operations on two integers. The menu should be repeated until user selects “STOP” option. Program should have independent user defined functions for each case.
Concept: Operators in C-Programming
Predict output of following program segment.
main()
{
int a,b,*p1,*p2,x,y;
clrscr();
a=48;b=10;p1=&a;p2=&b;
x=*p1**p2-8;
*p1=*p1+*p2;
y=(*p1/ *p2)+20;
printf("%d%d%d%d%d%d",*p1,*p2,a,b,x,y);
}
Concept: Data Input and Output in C-Programming
Predict output of following program segment.
main()
{
int x=4, y=9,z;
clrscr();
z=x++ + --y+y;
printf("\n%d%d%d",x,y,z);
z= --x+x+y--;
printf("\n%d%d%d",x,y,z);
getch();
}
Concept: Data Input and Output in C-Programming
Enlist bitwise operator in c language. Explain any 2 with examples.
Concept: Operators in C-Programming
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
