program for following output using for loop?
1 2 3 4 5
2 3 4 5
3 4 5
4 5
5

Answer Posted / letskools

I think th correct program is this for the above output
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
clrscr();

for(i=0;i<=5;i++)
{
for(j=i;j<=5;j++)
{
printf("%d",j);
}
printf("\n");
}
getch();
}

Is This Answer Correct ?    2 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the best way of making my program efficient?

561


What are static variables in c?

617


What is the equivalent code of the following statement in WHILE LOOP format?

759


How #define works?

607


In cryptography, you could often break the algorithm if you know what was the original (plain) text that was encoded into the current ciphertext. This is called the plain text attack. In this simple problem, we illustrate the plain text attack on a simple substitution cipher encryption, where you know each letter has been substituted with a different letter from the alphabet but you don’t know what that letter is. You are given the cipherText as the input string to the function getwordSets(). You know that a plain text "AMMUNITION" occurs somewhere in this cipher text. Now, you have to find out which sets of characters corresponds to the encrypted form of the "AMMUNITION". You can assume that the encryption follows simple substitution only. [Hint: You could use the pattern in the "AMMUNITION" like MM occurring twice together to identify this]

1952






if a is an integer variable, a=5/2; will return a value a) 2.5 b) 3 c) 2 d) 0

1438


how do you write a function that takes a variable number of arguments? What is the prototype of printf () function?

1486


write a program to input 10 strings and compare without using strcmp() function. If the character of one string matches with the characters of another string , sort them and make it a single string ??? example:- str1="Aakash" st2="Himanshu" str="Uday" output:- Aakashimanshuday (please post the answer as quickly as possible)

1617


What is use of pointer?

583


What is pointer in c?

731


What is the package for freshers(Non IIT) in amazon(hyderabad). And what is the same for those who are a contract employee.

3724


Describe the modifier in c?

596


I just typed in this program, and it is acting strangely. Can you see anything wrong with it?

554


How many keywords (reserve words) are in c?

604


Which type of language is c?

641