|
Share Thread: Facebook Twitter Google+ |
|
LinkBack | Thread Tools | Search this Thread |
#1
|
|||
|
|||
Answers required for computer science paper
Complete the code such that it prompts the user for +ve number n. Then displays the output.(whatever the value of n is)(HINT: instead of triangles of stars its triangles of increasing numbers)
1 2 3 4 . . . n 1 2 3 4 ..n-1 . . . . . . 1 2 1 for n=4 it will print 1 2 3 4 1 2 3 1 2 1 void main() { int n; cin>>n; // your loops will go here } In following code replace the character at posth location in the string st with the ,character ch. For example in string helloworld replacing 2nd character with i would result in hilloworld void main( ) {char st[15]; int pos; char ch; int size=0; cin>>st; cin>>pos>>ch; while(st[size]!='\0') { size++; // calculating length of current string } // write your code here |
Thread Tools | Search this Thread |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
latest MCQs on C.A and General knowledge | sono punam | Current Affairs | 2 | Friday, November 22, 2019 11:16 PM |
NAB Karachi 2016 Jobs | sajjadhussainjarwar | National Accountability Bureau (NAB) | 72 | Sunday, January 01, 2017 11:14 PM |
CULTURAL EXCHANGE SCHOLARSHIPS PROGRAMME FOR YEAR 2016 by IPC | fahadk | Scholarships | 358 | Friday, December 02, 2016 12:23 AM |