Posts

PROGRAM MATLAH

  clc; clear all ; % Enter the value Input Continuous signal Ts=0.04; % Sampling Time period of 50 Hz signal t=0:0.0005:0.02; fs = 1/Ts; % fs>=2fm, fm = 50Hz % Plot for Input Continuous signal n1=0:40; size(n1) xa_t=sin(2*pi*2*t/Ts); subplot(2,2,1); plot(200*t,xa_t); title( 'Verification of sampling theorem' ); title( 'Input Continuous signal' ); xlabel( 't(sec)' ); ylabel( 'x(t)' ); % Sampled signal; ts1=0.002; % > Nyquist rate ts2=0.01; % = Nyquist rate ts3=0.1; % < Nyquist rate n=0:20; x_ts1=2*sin(2*pi*n*ts1/Ts); subplot(2,2,2); stem(n, x_ts1); title( 'Sampling rate greater than Nq' ); xlabel( 'n' ); ylabel( 'x(n)' ); n=0:4; x_ts2=2*sin(2*pi*n*ts2/Ts); % Use numeric pi subplot(2,2,3); stem(n, x_ts2); title( 'Sampling rate equal to Nq' ); xlabel( 'n' ); ylabel( 'x(n)' ); n=0:10; x_ts3=2*sin(2*pi*n*ts3/Ts); subplot(2,2,4); stem(n, x_ts3); title( 'Sampling rate less than Nq' ); xlabel( ...

3.1.24 Test link

https://assessment.hackerearth.com/challenges/college/mks-service-batch-test-03-01-2024/pre/  https://shorturl.at/hmzCQ https://drive.google.com/drive/folders/1-jgnirOiDN_rm2C4ccwfWYgEJGSFEzQ5

Basics of Linked List

 #include<stdio.h> #include<stdlib.h> struct lnode{     int data;     struct lnode* next; }; typedef struct lnode node; node * head = NULL; void insertAtBeginning(int val) {    node* newNode=(node*)malloc(sizeof(node));    if(newNode==NULL) {        printf("Out of memory");        return;    }    newNode -> data = val;    if(head==NULL) {             // starting node is empty        newNode -> next = NULL;        head = newNode;    }    else {                       // starting node is head        newNode -> next = head;        head = newNode;    }    printf("inserted %d at the beginning",val); } void display() {     if(head==NULL) {...

C Program For String Compression

 C Program For String Compression #include <stdio.h> #include <string.h> int main() {     char ch[1000];     printf("Enter the string:\n");     scanf("%s",ch);     int length=strlen(ch);     printf("The length of a string is %d\n",length);     int count=1;     for(int i=0;i<length;i++)     {         if(ch[i]==ch[i+1])         {             count++;         }         else         {             printf("%c%d",ch[i],count);             count=1;         }     }     return 0; } OUTPUT: /tmp/9SZwGTxrSM.o Enter the string: sanjeevadharsh The length of a string is 14 s1a1n1j1e2v1a1d1h1a1r1s1h1 === Code Execution Successful ===

C PROGRAMMING BASICS

  C Language :          Procedural Programming Language  - Type of Programming Language that uses step by step procedure to solve the problems. Usage of Void main  #include <stdio.h> void main() {     printf("Welcome to C Programming Language"); }   Usage of Int main #include <stdio.h> int main() {     printf("Welcome to C Programming Language");     return 0; } Data Types Program #include <stdio.h> int main() {     int a=100;     long int n=1002365988545;     float b=25.69;     char c='a';     double d=45.696544;     printf("%d\n",a);     printf("%ld\n",n);     printf("%.2f\n",b);     printf("%c\n",c);     printf("%.2lf\n",d);     return 0; } Printing the all datatypes in same line #include <stdio.h> int main() {     int mark1=100,mark2=500,mark3=800;     int...