C program to find sum of two numbers
#include #include void main() { int a,b,s; clrscr(); printf(“Enter two no: ”); scanf(“%d%d",&a,&b); s=a+b; printf(“sum=%d”,s); getch(); } Output: Enter two no: 5 6 sum=11
q
#include #include void main() { int a,b,s; clrscr(); printf(“Enter two no: ”); scanf(“%d%d",&a,&b); s=a+b; printf(“sum=%d”,s); getch(); } Output: Enter two no: 5 6 sum=11
#include#include#include#include#include#includevoid sig_handler(int num){printf("nChild Sent a signal to parent:%dn",num);signal(SIGALRM,SIG_DFL);}int main(){int status;system("clear");printf("n--------Signal Handling Across Processes----------n");switch(fork()){case -1:perror("nFork Failed...n");exit(1);break;case 0:alarm(3);kill(getppid(),SIGALRM);//signal(SIGALRM,sig_handler);printf("nIts Child Processn");sleep(5);break;default:signal(SIGALRM,sig_handler);wait(&status);printf("nIts Parent Processn");}return 0;}
#include #include #include #include struct sigaction act; void sighandler(int signum, siginfo_t *info, void *ptr) { printf("Received signal %dn", signum); printf("Signal originates from process %lun", (unsigned long)info->si_pid); } int main() {…
#include #include #include int myfun(const char *pathname,const struct stat *statptr,int type); int main(int argc,char *argv[]) { nftw(argv[1],myfun,0,0); exit(0); } int myfun(const char *pathname,const struct stat *statptr,int type) { if(type==FTW_F) printf("nfile…
Concept: A linked list is a sequence of data structures, which are connected together via links. Linked List is a sequence of links which contains items. Each link contains a connection…
#include #include #include #include void main() { int gd = DETECT, gm; initgraph(&gd, &gm, "C:\TurboC3\BGI"); cleardevice(); line( 150, 100, 242, 100); ellipse(242, 105, 0, 90, 10, 5); line(150, 100, 120,…
LOGIC : Read the given input. If the given input matches with any operator symbol. Then display in terms of words of the particular symbol. Else print not a operator.PROGRAM: #include #include void main()…
C program to implement simple code generator