11-11-2010, 09:16 PM
Plz any one can send the solution of Cs502 . Today is extended day .........
|
CS502 Assignment Solution Required!!!!!!!!
|
|
11-11-2010, 09:16 PM
Plz any one can send the solution of Cs502 . Today is extended day .........
11-11-2010, 10:48 PM
Code: [COLOR=#000000][FONT=Times New Roman][FONT=arial][FONT=Arial][SIZE=3] Question # 1 Solution[/SIZE][/FONT]
[FONT=Arial][SIZE=3]y=0; //Initialize y=0[/SIZE][/FONT]
[FONT=Arial][SIZE=3]x=0; //Initialize x=0[/SIZE][/FONT]
[FONT=Arial][SIZE=3]for (i=n; i>0;i=i-1) // This loop will run approximately [B]n [/B]times[/SIZE][/FONT]
[FONT=Arial][SIZE=3]{ y=y+1;} // The loop will run approximately [B]n [/B]times and add the value of 1 in y.[/SIZE][/FONT]
[FONT=Arial][SIZE=3]for (i=1;i<=n;i=i*3) //This statement will run approximately [B]2n-1 [/B]times.[/SIZE][/FONT]
[FONT=Arial][SIZE=3]{ //First loop Start[/SIZE][/FONT]
[FONT=Arial][SIZE=3]for (j=1;j<=3n;++j) // In the nested loop, The variable j depends upon the value of 3n.[/SIZE][/FONT]
[FONT=Arial][SIZE=3]{ //Second loop Start[/SIZE][/FONT]
[FONT=Arial][SIZE=3]for(k=0;k<n; k=k+5) //In the nested loop again, The statement will run n/5 times[/SIZE][/FONT]
[FONT=Arial][SIZE=3]{ //Third loop Start[/SIZE][/FONT]
[FONT=Arial][SIZE=3]x=x+5; // The statement add 5 in the X variable.[/SIZE][/FONT]
[FONT=Arial][SIZE=3]} //Third loop close[/SIZE][/FONT]
[FONT=Arial][SIZE=3]} //Second loop close[/SIZE][/FONT]
[FONT=Arial]} //First loop close[/FONT][/FONT][/FONT][/COLOR]
11-12-2010, 12:20 AM
Bundle of Thanx
11-12-2010, 06:10 AM
welcome....
|
|
« Next Oldest | Next Newest »
|