Showing posts with label nptel. Show all posts
Showing posts with label nptel. Show all posts

Friday, 5 September 2014

NPTEL programming in C - Printing Right Triangles

You are given a positive integer N. You have to print N rows as follows. The first row consists of one 0, the second row 2 zeroes, and so on, until the Nth row, which consists of N zeroes.

Note : NPTEL follows gcc compiler which doesn't supports conio.h package and it always to be started as int main() and should return a integer value

 

NPTEL Programming in c - Sums of Powers of Numbers

In this program, you are given an input N, which is a positive integer less than or equal to 40. Write a program to find the sums of fourth powers of the first N numbers.

Sample Input
2

Sample Output
17


Note : NPTEL follows gcc compiler which doesn't supports conio.h package and it always to be started as int main() and should return a integer value

NPTEL Programming in C - Pythagorean Triples

Three numbers form a Pythagorean triple if the sum of squares of two numbers is equal to the square of the third.

 For example, 3, 5 and 4 form a Pythagorean triple, since 3*3 + 4*4 = 25 = 5*5

You are given three integers, a, b, and c. They need not be given in increasing order. If they form a Pythagorean triple, then print "yes", otherwise, print "no". Please note that the output message is in small letters.

Sample Input
3
5
4

Sample Output
yes

Note : NPTEL follows gcc compiler which doesn't supports conio.h package and it always to be started as int main() and should return a integer value