Академический Документы
Профессиональный Документы
Культура Документы
void main() { struct data { int roll =0; struct data1 { float phy; }x; x.phy=90; }y; cout<<y.roll<< <<y.phy; }
(b)
(a) Rewrite the following program after removing all syntactical
(2)
correction.
#include<iostream.h> int main() { structure student { int. rno, mark; }stu; student stuA= (1001,49); student stuB= stuA; if (stuA!= stuB) stuA.mark= 55; else stuB.mark= 25; cout<<stuA.mark<<stub.mark; }
(c) What will be the output of the following code:struct Item { int I_no; char I_name[20]; float I_price; int I_qty; }; void main() { Submitted By : Nita arora KHMS
(d)
Find the output of the following program: 3 #include <iostream.h> struct GAME { int Score; int Bonus; }; void Play(GAME &g, int N=10) { g.Score++;g.Bonus+=N; } void main() { GAME G={110,50}; Play(G,10); cout<<G.Score<<":"<<G.Bonus<<endl; Play(G); cout<<G.Score<<":"<<G.Bonus<<endl; Play(G,15); cout<<G.Score<<":"<<G.Bonus<<endl; }
(e)
Rewrite the following program after removing all syntactical error(s), if any. Underline each correction. #include<iostream.h> int main() { structure student { int. rno, mark; }stu; student stuA= (1001,49); student stuB= stuA; if (stuA!= stuB) stuA.mark= 55; else stuB.mark= 25; cout<<stuA.mark<<stub.mark;
Submitted By : Nita arora KHMS
(2)
(h)
(j)
(k)
I[2]={{101, Avinsash, 650.00}, {102, Manpreet,750.00}, {103, Saurabh, 660.00} }; void main( ) { cout<<I[0].Cust_No<<\n; cout<<I[0].Cust_Name[3]<\n; cout<<I[1].Unit_Price<<\n; cout<<I[2].Cust_Name<<\n; }
Find the output of the following program : #include<iostream.h> #include<conio.h> struct triangle { float angle; float base; float height; }; void display(triangle question) { cout<<endl<<base:<<question.base; cout<<endl<<height:<<question.height; cout<<endl<<angle:<<question.angle; } triangle difference(triangle one, triangle & two) Submitted By : Nita arora KHMS