\documentclass[11pt,a4paper]{article}
\usepackage[margin=1in]{geometry}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{wasysym}
\usepackage[T1]{fontenc}
\setlength{\parskip}{5pt}
\setlength{\parindent}{0pt}
\begin{document}
\pagestyle{empty}
\begin{center}
\hrule
\vspace*{10pt}
{\huge Introduction to Programming}
\vspace*{10pt}
{\large MTech CS, First Year, Indian Statistical Institute}
\vspace*{10pt}
\hrule
\vspace*{20pt}
\textbf{\Large Assignment 1 : Problem Solving using C}
Posted on 8 August 2014 $ \ \vert \ $ Due on 18 August 2014
\vspace*{10pt}
\end{center}
\subsubsection*{Submission Policy}
Write the theoretical part(s) of the solution(s) in \LaTeX, and submit individual codes separately. Your solution set should be in a compressed folder \texttt{\{RR\}\_assign1\_solutions.zip}, where \texttt{\{RR\}} is your roll number (e.g., \texttt{mtc1421}). It should contain a single PDF file for the theoretical part(s) of the solution(s), and individual C source file(s) for each solution.
In the theoretical part(s) of the solution(s), you must provide an (basic and informal) sketch of the algorithm that you use, along with a (naive and rough) complexity analysis of your chosen algorithm. You must also justify the C data-types that you use while writing the program.
The PDF file should provide a README portion for each C file, including the compilation and execution commands, and the input formats that a user should follow to execute the program.
\subsection*{Problem 1}
Write a simple C program, without exploiting the power of special libraries, that takes as user input three positive integers -- base $x$ (max 32 bits), exponent $n$ (max 32 bits), modulus $m$ (max 32 bits) -- and outputs the value of $x^n \bmod{m}$.
\subsection*{Problem 2}
Write a simple C program, without exploiting the power of special libraries, that takes as user input two positive integers -- value $x$ (max 32 bits), precision $p$ (max 60 bits) -- and outputs the value of $\sin(x)$, considering $x$ in radians, correct upto $p$ bits after the decimal point.
\subsection*{Problem 3}
Write a simple C program, without exploiting the power of special libraries, that takes as user input two positive integers -- value $x$ (max 32 bits), precision $p$ (max 60 bits) -- and outputs the value of $\sqrt{x}$, correct upto $p$ bits after the decimal point.
\subsection*{Bonus Problem}
Write a C program that takes as user input one positive integer $x$ (max 16 bits), and outputs the value of $x!$. Special credit will be given for algorithms with better-than-naive time complexity.
\vfill
\hfill Good Luck! {\Large\smiley{}}
\end{document}