Write a C program to manage array operation using switch case.
#include<stdio.h> #include<conio.h> #include<dos.h> void main() { int a[100]={12,45,41,96,32},i,j,m,n,p; clrscr(); printf("\n\n\t*** Proceed according to the instruction ***"); printf("\n\n\t\n\tFor Doing----\n\t\t\tINSERTION press-->> 1\n\t\t\tDELITION press-->> 2\n\t\t\tMODIFICATION press-->> 3\n\t\t\tEXIT press-->> 4\n"); printf("\n\n\tEnter Ur choice : "); scanf("%d",&i); switch(i) { case 1: { clrscr(); printf("\n\n\t\t\t\t***INSARTING***\n\n"); printf("\tThe present data in array....."); for(j=0;j<m;j++) { if(a[j]==NULL) break; printf("%d ",a[j]); } printf("\n\tenter the number which you want to insert---->> "); scanf("%d",&n); printf("\n\t\tEnter the position "); scanf("%d",&p); for(j=m;j>=p;j--) { a[j]=a[j-1]; } a[p]=n; printf("\n\n\n\t\tThe present data in array......\n\n\t\t\t "); for(j=0;j<=m;j++) { if(a[j]==NULL) break; else printf("%d ",a[j]); } getch(); break; } case 2: { clrscr(); printf("\n\n\t\t\t\t***DELETING***\n\n"); printf("\tThe present data in array....."); for(j=0;j<m;j++) { if(a[j]==NULL) break; printf("%d ",a[j]); } printf("\n\tenter the number which you want to delete---->>"); scanf("%d",&n); for(j=0;j<m;j++) { if(a[j]==n) { for(j=j;j<m;j++) { a[j]=a[j+1]; } } } printf("\n\n\n\t\tThe present data in array......\n\n\t\t\t "); for(j=0;j<m;j++) { if(a[j]==NULL) break; else printf("%d ",a[j]); } getch(); break; } case 3: { clrscr(); printf("\n\n\t\t\t\t***MODIFYING***\n\n"); printf("\tThe present data in array....."); for(j=0;j<m;j++) { if(a[j]==NULL) break; printf("%d ",a[j]); } printf("\n\tenter the number which you want to modify---->>"); scanf("%d",&n); for(j=0;j<m;j++) { if(a[j]==n) { printf("\n\tenter your currect number....."); scanf("%d",&a[j]); break; } } printf("\n\n\n\t\tThe present data in array......\n\n\t\t\t "); for(j=0;j<m;j++) { if(a[j]==NULL) break; else printf("%d ",a[j]); } getch(); break; } case 4: { exit(); break; } } main(); }
Write a C program to print the following pattern output.
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
Write a C program to calculate the following sum:
Sum = 1-x^2/2!+x^4/4!-x^6/6!+x^8/8!-x^10/10!
Write a C Program That Uses Functions To Delete N – Charactres From A Given Position In A Given String.
Write a C-Program That Uses Functions To Insert A Sub-String In To A Given Main String From A Given Position.
For the input expression (4*7+1)*2, construct an annotated parse tree.
What are the propositions of Putnam’s model?
Write short notes: B tree
Draw the ER diagram of a hospital and explain.
Explain two-phase locking protocol.
Write a C program to find minimum among three numbers.
What is ISO 9000 Certification? How to Get ISO 9000 Certification?