Final Round

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

FINAL ROUND Only those who are selected for the final rounds are supposed to mail their

programs. Others need not send their programs.


DEADLINE : Programmers are requested to submit their programs within 29th Aug evening 7 PM. Winners list will be announced in the website on 29th Aug evening 8 PM. QUESTION 1:
Write a C-Program to eliminate dead code from the given C-program Specifications : 1.C-Program must be passed as a file. 2.The Program developed must check the dead code and eliminate it and display the remaining part of the program which is passed as input.

Sample Input and Output : Enter the input file : inputcode.c inputcode.c : #include<stdio.h> void reverse() { printf(\nReverse Function); } #define true 1 int main() { int i=2; if(i==1) printf(\nThis is dead code); i=0;

if(i) { printf(\nThis is too a dead code); reverse(); } if(true) printf(\nThis is normal code); }

Output : #include<stdio.h> #define true 1 int main() { int i=2; i=0; if(true) printf(\nThis is normal code); }

QUESTION 2: Develop a C++ Program from the given partial code to find the sum of two complex numbers without overloading '+' operator.
Specifications : 1)Code can be added anywhere but the given code cant be removed or altered or eliminated as dead code for your convenience. 2)The expression c3=(((c1*c1)-(c2*c2))/(c2-c1)); must be used to derive c3 as sum of c1 and c2. 3)Here '+' operator must not be overloaded Program : class complex { int r,i; public complex(int real,int imag) { } } class execution { int main() { complex c1,c2,c3; c3=(((c1*c1)-(c2*c2))/(c2-c1));/* where c3=c1+c2 */ } } Sample Input and Output : INPUT : Enter the complex no 1 : 3+4i Enter the complex no 2 : 5+6i OUTPUT: Sum of Two Complex Numbers : 8+10i

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy