Skip to content

Instantly share code, notes, and snippets.

View Ehsan-hsr's full-sized avatar
😗
Out sick

Ehsan-hsr

😗
Out sick
View GitHub Profile
#include <unistd.h>
#include <stdio.h>
#include <sys/socket.h>
#include <stdlib.h>
#include <netinet/in.h>
#include <string.h>
int main(){
int sockfd, newSockfd;
struct sockaddr_in serv_addr, cli_addr;
import numpy as np
import matplotlib.pyplot as plt
#Carrier wave c(t)=A_c*cos(2*pi*f_c*t)
#Modulating wave m(t)=A_m*cos(2*pi*f_m*t)
#Modulated wave s(t)=A_c[1+mu*cos(2*pi*f_m*t)]cos(2*pi*f_c*t)
A_c = float(input('Enter carrier amplitude: '))
f_c = float(input('Enter carrier frquency: '))
A_m = float(input('Enter message amplitude: '))
from os import close
import sys
import getopt
def add(name, quantity, price):
with open('data', 'a') as f:
f.write(f"{name}-{quantity}-{price}\n")