×
Push yourself because, no one else is going to do it for you.
--Your friends at LectureNotes
Close

COMPUTER NETWORKS

by Sankalp Gupta
Type: NoteInstitute: GTU Course: B.Tech Specialization: Computer Science EngineeringOffline Downloads: 13Views: 542Uploaded: 10 months agoAdd to Favourite

Share it with your friends

Suggested Materials

Leave your Comments

Contributors

Sankalp Gupta
Sankalp Gupta
CHAPTER 1 1.1 Write a program that will print your mailing address in the following form : First line Second line Third line : Name : Door No, Street : City, Pin code Algorithm: Algorithm to print your mailing address. Step 1 Step 2 Step 3 : Display your Name and Go to new line. : Display your Door No and Street and Go to new line. : Display your City and Pin Code. Flowchart:START Display your Name & Go to new line Display your Door No and Street & go to new line Display your City and Pin Code END Program: // Write a program that will print your mailing //address in the following form: //First line : Name //Second line : Door No, Strret //Third line : City, Pin Code //Date : 11/03/2013
#include<stdio.h> #include<conio.h> void main() { clrscr(); printf("Name :-- HEMANT TRIVEDI\n"); printf("Door No :-- 103, Street :-- Aradhna \n"); printf("City :-- Bhavnagar , Pin Code :-- 364001"); getch(); } Output:-Name :-- HEMANT TRIVEDI | Door No:-- 103 Street:- Aradhna City:-- Bhavnagar, Pin Code:-- 364001 1.2 Modify the above program to provide border lines to the address. Algorithm: Algorithm to provide border lines to address. Step 1 Step 2 Step 3 Step 4 Step 5 Step 6 Step 7 : : : : : : : Display ------------------------------------------------- line and Go to new line. Display ------------------------------------------------- line and Go to new line. Display ||, your Name, || and Go to new line. Display ||, your Door No and Street, || and Go to new line. Display ||, your City, Pin Code, || and Go to new line. Display ------------------------------------------------- line and Go to new line. Display ------------------------------------------------- line. Flowchart :START Display -----------& go to new line Display -----------& go to new line A
A Display ||, your Name, || & go to new line Display ||, your Door No and Street, || & go to new line Display ||, your City and Pin Code, || and go to new line Display -----------& go to new line Display ------------ END Program:// Write a program that will print your mailing //address in the following form: //----------------------------------------//----------------------------------------//|| First line : Name || //|| Second line : Door No, Strret|| //|| Third line : City, Pin Code || //----------------------------------------//----------------------------------------//Date : 11/03/2013 #include<stdio.h> #include<conio.h> void main() { clrscr();
printf(" -----------------------------------------------\n"); printf(" -----------------------------------------------\n"); printf("|| Name :-- HEMANT TRIVEDI ||\n"); printf("|| Door No :-- 103 , Street :-- Aradhana ||\n"); printf("|| City :-- Bhavnagar , Pin Code :-- 364001 ||\n"); printf(" -----------------------------------------------\n"); printf(" -----------------------------------------------\n"); getch(); } Output:----------------------------------------------------------------------------------------------------|| Name :-- HEMANT TRIVEDI || || Door No:-- 103, Street:- Aradhana || ||City:-- Bhavnagar, Pin Code:-- 364001 || ----------------------------------------------------------------------------------------------------1.3 Write a program using one print statement to print the pattern of asterisks as shown below : * * * * * * * * * * Algorithm: Algorithm to print the pattern of pattern of asterisks. Step 1: Display * and go to new line Step 2: Display * * and go to new line. Step 3: Display * * * and go to new line. Step 4: Display * * * * Flowchart:START Display * & Go to new line Display * * & go to new line Display * * * & go to new line Display * * * * Program :- END

Lecture Notes