NPTEL Problem Solving Trough Programming In C | NPTEL Week 5 Programming Assignment | NPTEL Assignment Solutions

NPTEL Problem Solving Trough Programming In C Week 5 Programming Assignment | NPTEL Swayam Assignment Answers

 
problem solving through programming in C nptel


Nptel Week 5 Programming Assignment Answers:

Q.1: Write a C program to count total number of digits of an Integer number (N).


Code:




Q.2: Write a C program to find sum of following series where the value of N is taken as input
 1+ 1/2 + 1/3 + 1/4 + 1/5 + .. 1/N

write a C program to find sum of following series where the value of N is taken as input   1+ 1/2 + 1/3 + 1/4 + 1/5 + .. 1/N


Code:


Q.3: Write a C program to check whether the given number(N) can be expressed as Power of Two (2) or not.
For example 8 can be expressed as 2^3.


write a C program to check whether the given number(N) can be expressed as Power of two (2) or not. for example 8 can be expressed as 2^3.


Code:



Q.4: Write a C program to print the following Pyramid pattern upto Nth row. Where N (number of rows to be printed) is taken as input.
For example when the value of N is 5 the pyramid will be printed as follows

*****
****
***
**
*

write a C program to print the following pyramid pattern upto Nth row. where N (number of rows to be printed) is taken as input.


Code:



Post a Comment

0 Comments